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