commit
c6aaaeedfc
@ -14,7 +14,7 @@ public interface IUserFileService extends IService<UserFile> {
|
|||||||
|
|
||||||
IPage<FileListVO> userFileList(String userId, String filePath, Long beginCount, Long pageCount);
|
IPage<FileListVO> userFileList(String userId, String filePath, Long beginCount, Long pageCount);
|
||||||
void updateFilepathByUserFileId(String userFileId, String newfilePath, String userId);
|
void updateFilepathByUserFileId(String userFileId, String newfilePath, String userId);
|
||||||
void userFileCopy(String userFileId, String newfilePath, String userId);
|
void userFileCopy(String userId, String userFileId, String newfilePath);
|
||||||
|
|
||||||
IPage<FileListVO> getFileByFileType(Integer fileTypeId, Long currentPage, Long pageCount, String userId);
|
IPage<FileListVO> getFileByFileType(Integer fileTypeId, Long currentPage, Long pageCount, String userId);
|
||||||
List<UserFile> selectUserFileListByPath(String filePath, String userId);
|
List<UserFile> selectUserFileListByPath(String filePath, String userId);
|
||||||
|
@ -126,7 +126,7 @@ public class ShareController {
|
|||||||
log.info("查询文件列表:" + JSON.toJSONString(userfileList));
|
log.info("查询文件列表:" + JSON.toJSONString(userfileList));
|
||||||
String filePath = userFile.getFilePath();
|
String filePath = userFile.getFilePath();
|
||||||
userfileList.forEach(p->{
|
userfileList.forEach(p->{
|
||||||
p.setUserFileId(null);
|
p.setUserFileId(IdUtil.getSnowflakeNextIdStr());
|
||||||
p.setUserId(userId);
|
p.setUserId(userId);
|
||||||
p.setFilePath(p.getFilePath().replaceFirst(filePath + "/" + fileName, savefilePath + "/" + savefileName));
|
p.setFilePath(p.getFilePath().replaceFirst(filePath + "/" + fileName, savefilePath + "/" + savefileName));
|
||||||
saveUserFileList.add(p);
|
saveUserFileList.add(p);
|
||||||
|
@ -123,12 +123,14 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void userFileCopy(String userFileId, String newfilePath, String userId) {
|
public void userFileCopy(String userId, String userFileId, String newfilePath) {
|
||||||
UserFile userFile = userFileMapper.selectById(userFileId);
|
UserFile userFile = userFileMapper.selectById(userFileId);
|
||||||
String oldfilePath = userFile.getFilePath();
|
String oldfilePath = userFile.getFilePath();
|
||||||
|
String oldUserId = userFile.getUserId();
|
||||||
String fileName = userFile.getFileName();
|
String fileName = userFile.getFileName();
|
||||||
|
|
||||||
userFile.setFilePath(newfilePath);
|
userFile.setFilePath(newfilePath);
|
||||||
|
userFile.setUserId(userId);
|
||||||
userFile.setUserFileId(IdUtil.getSnowflakeNextIdStr());
|
userFile.setUserFileId(IdUtil.getSnowflakeNextIdStr());
|
||||||
if (userFile.getIsDir() == 0) {
|
if (userFile.getIsDir() == 0) {
|
||||||
String repeatFileName = fileDealComp.getRepeatFileName(userFile, userFile.getFilePath());
|
String repeatFileName = fileDealComp.getRepeatFileName(userFile, userFile.getFilePath());
|
||||||
@ -144,8 +146,8 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> imple
|
|||||||
newfilePath = new QiwenFile(newfilePath, fileName, true).getPath();
|
newfilePath = new QiwenFile(newfilePath, fileName, true).getPath();
|
||||||
|
|
||||||
|
|
||||||
if (userFile.isDirectory()) { //为null说明是目录,则需要移动子目录
|
if (userFile.isDirectory()) {
|
||||||
List<UserFile> subUserFileList = userFileMapper.selectUserFileByLikeRightFilePath(oldfilePath, userId);
|
List<UserFile> subUserFileList = userFileMapper.selectUserFileByLikeRightFilePath(oldfilePath, oldUserId);
|
||||||
|
|
||||||
for (UserFile newUserFile : subUserFileList) {
|
for (UserFile newUserFile : subUserFileList) {
|
||||||
newUserFile.setFilePath(newUserFile.getFilePath().replaceFirst(oldfilePath, newfilePath));
|
newUserFile.setFilePath(newUserFile.getFilePath().replaceFirst(oldfilePath, newfilePath));
|
||||||
@ -154,6 +156,7 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> imple
|
|||||||
String repeatFileName = fileDealComp.getRepeatFileName(newUserFile, newUserFile.getFilePath());
|
String repeatFileName = fileDealComp.getRepeatFileName(newUserFile, newUserFile.getFilePath());
|
||||||
newUserFile.setFileName(repeatFileName);
|
newUserFile.setFileName(repeatFileName);
|
||||||
}
|
}
|
||||||
|
newUserFile.setUserId(userId);
|
||||||
try {
|
try {
|
||||||
userFileMapper.insert(newUserFile);
|
userFileMapper.insert(newUserFile);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user