|
@@ -264,8 +264,8 @@ public class CompatibleOldFileController {
|
|
|
return INCORRECT_PARAMETERS;
|
|
|
}
|
|
|
|
|
|
- if (!OldFileAppContext.getContext().getOverwrite() &&
|
|
|
- null!=fileService.load(OldFileAppContext.getContext().getKey())){
|
|
|
+ FileInfo fileInfo = fileService.load(OldFileAppContext.getContext().getKey());
|
|
|
+ if (!OldFileAppContext.getContext().getOverwrite() && null!=fileInfo){
|
|
|
return FILE_EXISTED;
|
|
|
}
|
|
|
String uploadId = compatibleOldFileService.registerMultipartUpload();
|
|
@@ -317,14 +317,6 @@ public class CompatibleOldFileController {
|
|
|
jsonObj.put("TotalCount", 0);
|
|
|
|
|
|
FileMd5 fileMd5 = fileMd5Service.queryFileMd5ByFileMd5(md5);
|
|
|
- if (ObjectUtil.isNotEmpty(fileMd5) && FileCommonConst.UPLOAD_SUCCESS.equals(fileMd5.getUploadStatus())){
|
|
|
-
|
|
|
- jsonObj.put("TotalCount", totalChunks);
|
|
|
- return jsonObj.toJSONString();
|
|
|
- }
|
|
|
-
|
|
|
- IFileStorageService service = FileStorageFactory.getService();
|
|
|
- service.uploadChuck(service.getChuckBucketName(null),md5,file.getInputStream(),totalChunks,chunkNumber);
|
|
|
|
|
|
if (StrUtil.isBlank(fileInfo.getFileMd5())){
|
|
|
fileInfo.setFileMd5(md5);
|
|
@@ -333,7 +325,15 @@ public class CompatibleOldFileController {
|
|
|
}
|
|
|
fileService.updateById(fileInfo);
|
|
|
}
|
|
|
-
|
|
|
+ if (ObjectUtil.isNotEmpty(fileMd5) && FileCommonConst.UPLOAD_SUCCESS.equals(fileMd5.getUploadStatus())){
|
|
|
+
|
|
|
+ jsonObj.put("TotalCount", totalChunks);
|
|
|
+ return jsonObj.toJSONString();
|
|
|
+ }
|
|
|
+
|
|
|
+ IFileStorageService service = FileStorageFactory.getService();
|
|
|
+ service.uploadChuck(service.getChuckBucketName(null),md5,file.getInputStream(),totalChunks,chunkNumber);
|
|
|
+
|
|
|
if (ObjectUtil.isEmpty(fileMd5)){
|
|
|
FileMd5 fileMd5Create = FileMd5Creator.of(fileInfo.getCreator(), md5, FileCommonConst.UPLOAD_PART);
|
|
|
fileMd5Create.setFileSize(totalSize);
|