|
@@ -615,9 +615,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
// if(StrUtil.isNotEmpty(filePathStr)){
|
|
|
// updateWrapper.set(SceneEditInfo::getFloorPlanPath, filePathStr);
|
|
|
// }
|
|
|
- if(StrUtil.isNotEmpty(cadInfo)){
|
|
|
- updateWrapper.set(SceneEditInfo::getCadInfo, cadInfo);
|
|
|
- }
|
|
|
+// if(StrUtil.isNotEmpty(cadInfo)){
|
|
|
+// updateWrapper.set(SceneEditInfo::getCadInfo, cadInfo);
|
|
|
+// }
|
|
|
if(floorPlanUser != null){
|
|
|
updateWrapper.set(SceneEditInfo::getFloorPlanUser, floorPlanUser);
|
|
|
}
|
|
@@ -626,7 +626,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneEditInfoDb = new SceneEditInfo();
|
|
|
sceneEditInfoDb.setScenePlusId(scenePlus.getId());
|
|
|
// sceneEditInfoDb.setFloorPlanPath(filePathStr);
|
|
|
- sceneEditInfoDb.setCadInfo(cadInfo);
|
|
|
+// sceneEditInfoDb.setCadInfo(cadInfo);
|
|
|
sceneEditInfoDb.setFloorPlanUser(floorPlanUser);
|
|
|
this.save(sceneEditInfoDb);
|
|
|
}
|
|
@@ -719,9 +719,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
public ResultData uploadPanorama(String num, MultipartFile file) throws Exception {
|
|
|
|
|
|
//校验压缩包格式
|
|
|
- log.info("全景图压缩包文件名:" + file.getOriginalFilename());
|
|
|
- if(!file.getOriginalFilename().endsWith(".zip")){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_7015);
|
|
|
+// log.info("全景图压缩包文件名:" + file.getOriginalFilename());
|
|
|
+// if(!file.getOriginalFilename().endsWith(".zip")){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_7015);
|
|
|
+// }
|
|
|
+ if(!file.getOriginalFilename().endsWith(".zip") || !file.getOriginalFilename().endsWith(".jpg")){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_7007, "jpg或者zip");
|
|
|
}
|
|
|
|
|
|
// ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
@@ -754,15 +757,19 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
file.transferTo(targetFile);
|
|
|
|
|
|
- //解压zip包
|
|
|
- FileUtil.unZip(zipTargetFilePath, targetImagesPath);
|
|
|
- //删除压缩包
|
|
|
- FileUtil.delFile(zipTargetFilePath);
|
|
|
+ //如果是压缩包上传,需要解压缩
|
|
|
+ if(file.getOriginalFilename().endsWith(".zip")){
|
|
|
+ //解压zip包
|
|
|
+ FileUtil.unZip(zipTargetFilePath, targetImagesPath);
|
|
|
+ //删除压缩包
|
|
|
+ FileUtil.delFile(zipTargetFilePath);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//获取解压后的文件列表
|
|
|
List<String> uploadFileList = FileUtil.getFileList(targetImagesPath);
|
|
|
if(CollUtil.isEmpty(uploadFileList)){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_7014);
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5062);
|
|
|
}
|
|
|
|
|
|
//判断是否有可用的jpg文件
|
|
@@ -777,7 +784,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
});
|
|
|
}
|
|
|
if(!existJpg){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5061);
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5062);
|
|
|
}
|
|
|
|
|
|
//列出caches/images中的文件列表
|
|
@@ -803,7 +810,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //判断成功的图片
|
|
|
+ //判断成功的图片,如果成功图片为0,就直接返回,不需要执行算法
|
|
|
uploadFileList = FileUtil.getFileList(targetImagesPath);
|
|
|
if(CollUtil.isEmpty(uploadFileList)){
|
|
|
if(CollUtil.isNotEmpty(notExistFileList)){
|
|
@@ -932,13 +939,15 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
|
this.upgradeVersionById(sceneEditInfo.getId());
|
|
|
|
|
|
+ //如果部分成功,则需要返回成功数量和失败列表
|
|
|
if(CollUtil.isNotEmpty(notExistFileList)){
|
|
|
notExistFileList = notExistFileList.stream().map(filePath -> {
|
|
|
return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
|
}).collect(Collectors.toList());
|
|
|
+ return ResultData.ok(new UploadPanoramaVO(uploadFileList.size(), notExistFileList));
|
|
|
}
|
|
|
|
|
|
- return ResultData.ok(new UploadPanoramaVO(uploadFileList.size(), notExistFileList));
|
|
|
+ return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
@Override
|