|
@@ -79,7 +79,8 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
return uploadModelZip(name.replace(extName, ""),tempFile,dictId);
|
|
return uploadModelZip(name.replace(extName, ""),tempFile,dictId);
|
|
}
|
|
}
|
|
//localToOssUtil.uploadOss(tempFile.getPath(), ossPath);
|
|
//localToOssUtil.uploadOss(tempFile.getPath(), ossPath);
|
|
- String url = this.ossUrlPrefix + ossPath;
|
|
|
|
|
|
+ //String url = this.ossUrlPrefix + ossPath;
|
|
|
|
+ String url = tempFile.getPath();
|
|
|
|
|
|
FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(extName.replace(".", ""));
|
|
FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(extName.replace(".", ""));
|
|
if(fileTypeEnum == null){
|
|
if(fileTypeEnum == null){
|
|
@@ -133,14 +134,14 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
String resultFormat = modelFileFormat;
|
|
String resultFormat = modelFileFormat;
|
|
switch (modelFileFormat){
|
|
switch (modelFileFormat){
|
|
case "obj" : resultFormat = "glb";
|
|
case "obj" : resultFormat = "glb";
|
|
- url = uploadObjOss(ossZipPath,modelFile);break;
|
|
|
|
- case "laz" : url = uploadLazOss(ossZipPath,modelFile); break;
|
|
|
|
- case "shp" : url = uploadOss(ossZipPath,modelFile); break;
|
|
|
|
- case "b3dm" : url = uploadB3dm(ossZipPath,modelFile); break;
|
|
|
|
|
|
+ url = uploadObjOss(unZipFile.getPath(),modelFile);break;
|
|
|
|
+ case "laz" : url = uploadLazOss(unZipFile.getPath(),modelFile); break;
|
|
|
|
+ case "shp" : url = uploadOss(unZipFile.getPath(),modelFile); break;
|
|
|
|
+ case "b3dm" : url = uploadB3dm(unZipFile.getPath(),modelFile); break;
|
|
case "las" :
|
|
case "las" :
|
|
- case "ply" : url = uploadLasOrPly(ossZipPath,modelFile);break;
|
|
|
|
|
|
+ case "ply" : url = uploadLasOrPly(unZipFile.getPath(),modelFile);break;
|
|
case "osgb": resultFormat = "b3dm";
|
|
case "osgb": resultFormat = "b3dm";
|
|
- uploadOsgb(ossZipPath,modelFile) ;break;
|
|
|
|
|
|
+ uploadOsgb(unZipFile.getPath(),modelFile) ;break;
|
|
default: break;
|
|
default: break;
|
|
}
|
|
}
|
|
FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(modelFileFormat);
|
|
FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(modelFileFormat);
|
|
@@ -186,21 +187,24 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
OsgbToB3dmConsumer osgbToB3dmConsumer;
|
|
OsgbToB3dmConsumer osgbToB3dmConsumer;
|
|
|
|
|
|
private void uploadOsgb(String unzipPath, File modelFile) {
|
|
private void uploadOsgb(String unzipPath, File modelFile) {
|
|
- osgbToB3dmConsumer.consumerQueue(CacheUtil.basePath + unzipPath);
|
|
|
|
|
|
+ //osgbToB3dmConsumer.consumerQueue(CacheUtil.basePath + unzipPath);
|
|
|
|
+ osgbToB3dmConsumer.consumerQueue(unzipPath);
|
|
}
|
|
}
|
|
|
|
|
|
private String uploadLazOss(String unzipPath,File modelFile) {
|
|
private String uploadLazOss(String unzipPath,File modelFile) {
|
|
if(!modelFile.exists()){
|
|
if(!modelFile.exists()){
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
|
|
}
|
|
}
|
|
- return ossUrlPrefix +unzipPath +File.separator +modelFile.getParentFile().getName();
|
|
|
|
|
|
+ // return ossUrlPrefix +unzipPath +File.separator +modelFile.getParentFile().getName();
|
|
|
|
+ return modelFile.getParentFile().getPath();
|
|
}
|
|
}
|
|
|
|
|
|
private String uploadOss(String unzipPath,File modelFile) {
|
|
private String uploadOss(String unzipPath,File modelFile) {
|
|
if(!modelFile.exists()){
|
|
if(!modelFile.exists()){
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
|
|
}
|
|
}
|
|
- return ossUrlPrefix + unzipPath+File.separator +modelFile.getName();
|
|
|
|
|
|
+ // return ossUrlPrefix + unzipPath+File.separator +modelFile.getName();
|
|
|
|
+ return modelFile.getPath();
|
|
}
|
|
}
|
|
|
|
|
|
private String uploadLasOrPly(String unzipPath ,File modelFile) {
|
|
private String uploadLasOrPly(String unzipPath ,File modelFile) {
|
|
@@ -209,7 +213,8 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
if(!file.exists()){
|
|
if(!file.exists()){
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
|
|
}
|
|
}
|
|
- return ossUrlPrefix +unzipPath+File.separator +mntFile.getName() + File.separator +"webcloud";
|
|
|
|
|
|
+ // return ossUrlPrefix +unzipPath+File.separator +mntFile.getName() + File.separator +"webcloud";
|
|
|
|
+ return mntFile.getPath()+ File.separator +"webcloud";
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|