commit
215d7fbe1f
@ -122,15 +122,11 @@ public class OfficeController {
|
||||
userFile.setFileId(fileBean.getFileId());
|
||||
userFileService.save(userFile);
|
||||
}
|
||||
|
||||
result.success();
|
||||
result.setMessage("文件创建成功!");
|
||||
return RestResult.success().message("文件创建成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
result.setCode(500);
|
||||
result.setMessage("服务器错误!");
|
||||
return RestResult.fail().message(e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Operation(summary = "预览office文件", description = "预览office文件", tags = {"office"})
|
||||
|
@ -202,7 +202,7 @@ public class FiletransferService implements IFiletransferService {
|
||||
userFile.setIsDir(0);
|
||||
List<UserFile> userFileList = userFileMapper.selectList(new QueryWrapper<>(userFile));
|
||||
if (userFileList.size() > 0) {
|
||||
String fileName = fileDealComp.getRepeatFileName(userFile, uploadFileDto.getFilePath());
|
||||
String fileName = fileDealComp.getRepeatFileName(userFile, userFile.getFilePath());
|
||||
userFile.setFileName(fileName);
|
||||
}
|
||||
userFile.setFileId(fileBean.getFileId());
|
||||
@ -391,7 +391,6 @@ public class FiletransferService implements IFiletransferService {
|
||||
}
|
||||
PreviewFile previewFile = new PreviewFile();
|
||||
previewFile.setFileUrl(fileBean.getFileUrl());
|
||||
// previewFile.setFileSize(fileBean.getFileSize());
|
||||
try {
|
||||
if ("true".equals(previewDTO.getIsMin())) {
|
||||
previewer.imageThumbnailPreview(httpServletResponse, previewFile);
|
||||
|
@ -118,13 +118,13 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> impl
|
||||
oldfilePath = oldfilePath + fileName + "/";
|
||||
newfilePath = newfilePath + fileName + "/";
|
||||
|
||||
oldfilePath = oldfilePath.replace("\\", "\\\\\\\\");
|
||||
oldfilePath = oldfilePath.replace("'", "\\'");
|
||||
oldfilePath = oldfilePath.replace("%", "\\%");
|
||||
oldfilePath = oldfilePath.replace("_", "\\_");
|
||||
|
||||
if (StringUtils.isEmpty(extendName)) { //为空说明是目录,则需要移动子目录
|
||||
userFileMapper.updateFilepathByFilepath(oldfilePath, newfilePath, userId);
|
||||
List<UserFile> list = selectFileListLikeRightFilePath(oldfilePath, userId);
|
||||
|
||||
for (UserFile newUserFile : list) {
|
||||
newUserFile.setFilePath(newUserFile.getFilePath().replaceFirst(oldfilePath, newfilePath));
|
||||
userFileMapper.updateById(newUserFile);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.qiwenshare.file.util;
|
||||
|
||||
import com.qiwenshare.common.constant.PlatformEnum;
|
||||
import com.qiwenshare.common.util.CollectUtil;
|
||||
import com.qiwenshare.common.util.DateUtil;
|
||||
import com.qiwenshare.file.domain.OperationLogBean;
|
||||
@ -29,7 +30,7 @@ public class OperationLogUtil {
|
||||
operationLogBean.setResult(isSuccess);
|
||||
operationLogBean.setOperation(operation);
|
||||
operationLogBean.setDetail(detail);
|
||||
operationLogBean.setPlatform(3);
|
||||
operationLogBean.setPlatform(PlatformEnum.PAN.getCode());
|
||||
|
||||
return operationLogBean;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user