|
@@ -59,68 +59,65 @@ public class UploadResultDataHandler {
|
|
|
}
|
|
|
List<ScenePlus> list = scenePlusService.list(queryWrapper);
|
|
|
|
|
|
- if(CollUtil.isEmpty(list)){
|
|
|
- return;
|
|
|
- }
|
|
|
- list.parallelStream().forEach(plus->{
|
|
|
- try {
|
|
|
- String ossResultPath = String.format(UploadFilePath.scene_result_data_path, plus.getNum());
|
|
|
- Map<String, String> uploadMap = new HashMap<>();
|
|
|
- ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(plus.getId());
|
|
|
- String dataSource = scenePlusExt.getDataSource();
|
|
|
- if(StrUtil.isNotEmpty(dataSource)){
|
|
|
- //上传caches/images
|
|
|
- String localCachesImagePath = dataSource + "/caches/images/";
|
|
|
- String ossCachesImagePath = ossResultPath + "caches/images/";
|
|
|
- //先清除旧的全景图
|
|
|
- fYunFileService.deleteFolder(ossCachesImagePath);
|
|
|
- if(FileUtil.exist(localCachesImagePath)){
|
|
|
- List<String> imagesList = FileUtil.listFileNames(localCachesImagePath);
|
|
|
- if(CollUtil.isNotEmpty(imagesList)){
|
|
|
- String visionPath = dataSource + "/results/vision.txt";
|
|
|
- List<String> panoramaImageList = SceneUtil.getPanoramaImageList(FileUtil.readUtf8String(visionPath));
|
|
|
- imagesList.stream().forEach(fileName -> {
|
|
|
- if (panoramaImageList.contains(fileName)) {
|
|
|
- String srcPath = localCachesImagePath + fileName;
|
|
|
- String ossPath = ossCachesImagePath + fileName;
|
|
|
- uploadMap.put(srcPath, ossPath);
|
|
|
- }
|
|
|
- });
|
|
|
+ if(CollUtil.isNotEmpty(list)){
|
|
|
+ list.parallelStream().forEach(plus->{
|
|
|
+ try {
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, plus.getNum());
|
|
|
+ Map<String, String> uploadMap = new HashMap<>();
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(plus.getId());
|
|
|
+ String dataSource = scenePlusExt.getDataSource();
|
|
|
+ if(StrUtil.isNotEmpty(dataSource)){
|
|
|
+ //上传caches/images
|
|
|
+ String localCachesImagePath = dataSource + "/caches/images/";
|
|
|
+ String ossCachesImagePath = ossResultPath + "caches/images/";
|
|
|
+ //先清除旧的全景图
|
|
|
+ fYunFileService.deleteFolder(ossCachesImagePath);
|
|
|
+ if(FileUtil.exist(localCachesImagePath)){
|
|
|
+ List<String> imagesList = FileUtil.listFileNames(localCachesImagePath);
|
|
|
+ if(CollUtil.isNotEmpty(imagesList)){
|
|
|
+ String visionPath = dataSource + "/results/vision.txt";
|
|
|
+ List<String> panoramaImageList = SceneUtil.getPanoramaImageList(FileUtil.readUtf8String(visionPath));
|
|
|
+ imagesList.stream().forEach(fileName -> {
|
|
|
+ if (panoramaImageList.contains(fileName)) {
|
|
|
+ String srcPath = localCachesImagePath + fileName;
|
|
|
+ String ossPath = ossCachesImagePath + fileName;
|
|
|
+ uploadMap.put(srcPath, ossPath);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- //上传vision.txt
|
|
|
- String localVisionPath = dataSource + "/results/vision.txt";
|
|
|
- String ossVisionJsonPath = String.format(UploadFilePath.IMG_VIEW_PATH, plus.getNum()) + "vision.txt";
|
|
|
- if(FileUtil.exist(localVisionPath)){
|
|
|
- uploadMap.put(localVisionPath, ossVisionJsonPath);
|
|
|
- }
|
|
|
+ //上传vision.txt
|
|
|
+ String localVisionPath = dataSource + "/results/vision.txt";
|
|
|
+ String ossVisionJsonPath = String.format(UploadFilePath.IMG_VIEW_PATH, plus.getNum()) + "vision.txt";
|
|
|
+ if(FileUtil.exist(localVisionPath)){
|
|
|
+ uploadMap.put(localVisionPath, ossVisionJsonPath);
|
|
|
+ }
|
|
|
|
|
|
- //上传project.json
|
|
|
- String localProjectJsonPath = dataSource + "/project.json";
|
|
|
- String ossProjectJsonPath = ossResultPath + "project.json";
|
|
|
- if(FileUtil.exist(localProjectJsonPath)){
|
|
|
- uploadMap.put(localProjectJsonPath, ossProjectJsonPath);
|
|
|
- }
|
|
|
+ //上传project.json
|
|
|
+ String localProjectJsonPath = dataSource + "/project.json";
|
|
|
+ String ossProjectJsonPath = ossResultPath + "project.json";
|
|
|
+ if(FileUtil.exist(localProjectJsonPath)){
|
|
|
+ uploadMap.put(localProjectJsonPath, ossProjectJsonPath);
|
|
|
+ }
|
|
|
|
|
|
- //上传data.json
|
|
|
- String localDataJsonPath = dataSource + "/data.json";
|
|
|
- String ossDataJsonPath = ossResultPath + "data.json";
|
|
|
- if(FileUtil.exist(localDataJsonPath)){
|
|
|
- uploadMap.put(localDataJsonPath, ossDataJsonPath);
|
|
|
- }
|
|
|
+ //上传data.json
|
|
|
+ String localDataJsonPath = dataSource + "/data.json";
|
|
|
+ String ossDataJsonPath = ossResultPath + "data.json";
|
|
|
+ if(FileUtil.exist(localDataJsonPath)){
|
|
|
+ uploadMap.put(localDataJsonPath, ossDataJsonPath);
|
|
|
+ }
|
|
|
|
|
|
- //开始上传
|
|
|
- fYunFileService.uploadMulFiles(uploadMap);
|
|
|
+ //开始上传
|
|
|
+ fYunFileService.uploadMulFiles(uploadMap);
|
|
|
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("上传结算结果失败,num=" + plus.getNum(), e);
|
|
|
+ faildNumList.add(plus.getNum());
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- log.error("上传结算结果失败,num=" + plus.getNum(), e);
|
|
|
- faildNumList.add(plus.getNum());
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
XxlJobHelper.log("uploadResultData end.....");
|
|
|
XxlJobHelper.log("上传失败场景码:" + JSON.toJSONString(faildNumList));
|