|
@@ -114,7 +114,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
}
|
|
|
|
|
|
private ResultData uploadModelZip(String oldName,File file,Integer dictId) {
|
|
|
-
|
|
|
+ Long fileSize = file.length();
|
|
|
String ossZipPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, UUID.randomUUID().toString().replace("-", ""));
|
|
|
String unzipPath = CacheUtil.basePath + ossZipPath;
|
|
|
ShellUtil.unZip(file.getPath(),unzipPath);
|
|
@@ -180,7 +180,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
|
|
|
Integer status = StringUtils.isNotBlank(url) ?1:-1;
|
|
|
url = StringUtils.isNotBlank(url) ?ossUrlPrefix + url:null;
|
|
|
- CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(getDirectorySize(unZipFile)),
|
|
|
+ CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(fileSize),
|
|
|
null, fileTypeEnum, modelFileFormat,resultFormat,status,unZipFile.getPath(),dictId);
|
|
|
if("osgb".equals(modelFileFormat)){
|
|
|
//commonUploadService.updateStatus(commonUpload.getId(),0);
|
|
@@ -327,6 +327,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
+ log.info("getDirectorySize:{}",e);
|
|
|
}
|
|
|
return size;
|
|
|
}
|