commit
080189629a
@ -148,6 +148,7 @@ public class FileDealComp {
|
||||
* @param sessionUserId
|
||||
*/
|
||||
public void deleteRepeatSubDirFile(String filePath, Long sessionUserId) {
|
||||
log.debug("删除子目录:"+filePath);
|
||||
LambdaQueryWrapper<UserFile> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
lambdaQueryWrapper.select(UserFile::getFileName, UserFile::getFilePath)
|
||||
@ -269,7 +270,7 @@ public class FileDealComp {
|
||||
elasticSearchService.save(fileSearch);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("ES更新操作失败,请检查配置");
|
||||
log.debug("ES更新操作失败,请检查配置");
|
||||
}
|
||||
});
|
||||
|
||||
@ -281,7 +282,7 @@ public class FileDealComp {
|
||||
try {
|
||||
elasticSearchService.deleteById(userFileId);
|
||||
} catch (Exception e) {
|
||||
log.error("ES删除操作失败,请检查配置");
|
||||
log.debug("ES删除操作失败,请检查配置");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -55,10 +55,7 @@ public class FiletransferController {
|
||||
FileDealComp fileDealComp;
|
||||
@Resource
|
||||
StorageService storageService;
|
||||
@Resource
|
||||
ShareService shareService;
|
||||
@Resource
|
||||
ShareFileService shareFileService;
|
||||
|
||||
public static final String CURRENT_MODULE = "文件传输接口";
|
||||
|
||||
@Operation(summary = "极速上传", description = "校验文件MD5判断文件是否存在,如果存在直接上传成功并返回skipUpload=true,如果不存在返回skipUpload=false需要再次调用该接口的POST方法", tags = {"filetransfer"})
|
||||
@ -77,7 +74,7 @@ public class FiletransferController {
|
||||
UploadFileVo uploadFileVo = new UploadFileVo();
|
||||
Map<String, Object> param = new HashMap<String, Object>();
|
||||
param.put("identifier", uploadFileDto.getIdentifier());
|
||||
synchronized (FiletransferController.class) {
|
||||
|
||||
List<FileBean> list = fileService.listByMap(param);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
FileBean file = list.get(0);
|
||||
@ -89,6 +86,7 @@ public class FiletransferController {
|
||||
if (relativePath.contains("/")) {
|
||||
userFile.setFilePath(uploadFileDto.getFilePath() + PathUtil.getParentPath(relativePath) + "/");
|
||||
fileDealComp.restoreParentFilePath(uploadFileDto.getFilePath() + PathUtil.getParentPath(relativePath) + "/", sessionUserBean.getUserId());
|
||||
fileDealComp.deleteRepeatSubDirFile(uploadFileDto.getFilePath(), sessionUserBean.getUserId());
|
||||
} else {
|
||||
userFile.setFilePath(uploadFileDto.getFilePath());
|
||||
}
|
||||
@ -116,7 +114,6 @@ public class FiletransferController {
|
||||
uploadFileVo.setSkipUpload(false);
|
||||
|
||||
}
|
||||
}
|
||||
return RestResult.success().data(uploadFileVo);
|
||||
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class TaskController {
|
||||
try {
|
||||
elasticSearchService.deleteAll();
|
||||
} catch (Exception e) {
|
||||
log.error("删除ES失败:" + e);
|
||||
log.debug("删除ES失败:" + e);
|
||||
}
|
||||
|
||||
List<UserFile> userfileList = userFileService.list();
|
||||
|
@ -103,6 +103,7 @@ public class FiletransferService implements IFiletransferService {
|
||||
if (relativePath.contains("/")) {
|
||||
userFile.setFilePath(uploadFileDto.getFilePath() + PathUtil.getParentPath(relativePath) + "/");
|
||||
fileDealComp.restoreParentFilePath(uploadFileDto.getFilePath() + PathUtil.getParentPath(relativePath) + "/", userId);
|
||||
fileDealComp.deleteRepeatSubDirFile(uploadFileDto.getFilePath(), userId);
|
||||
|
||||
} else {
|
||||
userFile.setFilePath(uploadFileDto.getFilePath());
|
||||
|
Loading…
Reference in New Issue
Block a user