|
@@ -41,8 +41,8 @@ public class OsgbToB3dmConsumer {
|
|
|
@Autowired
|
|
|
LocalToOssUtil localToOssUtil;
|
|
|
|
|
|
- @Async
|
|
|
- public void consumerQueue(Integer uploadId) {
|
|
|
+ //@Async
|
|
|
+ public Integer consumerQueue(Integer uploadId) {
|
|
|
String sourcePath = null;
|
|
|
String localPath = null;
|
|
|
try {
|
|
@@ -51,7 +51,7 @@ public class OsgbToB3dmConsumer {
|
|
|
File file = new File(localPath);
|
|
|
if(!file.exists()){
|
|
|
log.info("osgbToB3dm-mq--,msg:{},文件不存在",localPath);
|
|
|
- return;
|
|
|
+ return -1;
|
|
|
}
|
|
|
//commonUploadService.updateStatus(uploadId,0);
|
|
|
///mnt/manage/media-library/result/ea041f3237df46568f4e83e723e743d4
|
|
@@ -62,12 +62,12 @@ public class OsgbToB3dmConsumer {
|
|
|
String b3dmJsonPath = FileWriterUtil.checkB3dmTileset(new File(sourcePath));
|
|
|
if(b3dmJsonPath == null){
|
|
|
log.info("osgbToB3dm-mq,msg:{},转化失败tileset.json不存在",localPath);
|
|
|
- throw new BusinessException(-1,"转化失败tileset.json不存在");
|
|
|
+ return -1;
|
|
|
}
|
|
|
File jsonFile = new File(b3dmJsonPath);
|
|
|
if(!jsonFile.exists()){
|
|
|
log.info("osgbToB3dm-mq,msg:{},转化失败tileset.json不存在",localPath);
|
|
|
- throw new BusinessException(-1,"转化失败tileset.json不存在");
|
|
|
+ return -1;
|
|
|
}
|
|
|
//String ossPath = sourcePath.replace(CacheUtil.basePath,"");
|
|
|
//localToOssUtil.uploadOss(sourcePath,ossPath);
|
|
@@ -78,12 +78,13 @@ public class OsgbToB3dmConsumer {
|
|
|
}else {
|
|
|
commonUploadService.updateByPath(uploadId,url);
|
|
|
}
|
|
|
-
|
|
|
+ return 1;
|
|
|
}catch (Exception e){
|
|
|
log.info("osgbToB3dm-status----消费失败",e);
|
|
|
if(localPath != null){
|
|
|
commonUploadService.updateStatus(uploadId,-1);
|
|
|
}
|
|
|
+ return -1;
|
|
|
}finally {
|
|
|
try {
|
|
|
FileUtil.del(localPath);
|