Compare commits

..

No commits in common. "ad2f822dcaf4f106ad80b1c4b2ddc9930b45fc00" and "54a6901dbb5a7942b2e14d83cf165b81383ca7a3" have entirely different histories.

1 changed files with 3 additions and 10 deletions

View File

@ -151,7 +151,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
if (fileIdsWithTags.isEmpty()) {
return ElectromagneticResultUtil.success(new RespPageVO<>(0, new ArrayList<>()));
}
queryWrapper.in(EdFileInfo::getFileId, fileIdsWithTags);
queryWrapper.in(EdFileInfo::getId, fileIdsWithTags);
}
Page<EdFileInfo> edFileInfoPage = this.baseMapper.selectPage(new Page<>(pars.getPageNum(), pars.getPageSize()), queryWrapper);
@ -160,7 +160,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
records.forEach(e -> {
e.setFileSizeShow(EleCommonUtil.convertFileSize(e.getFileSize()));
e.setIsFavorite(isFavorite(UserThreadLocal.getUserId(), e.getId()) ? 1 : 0);
e.setLabels(fileTagRelationService.getFileTags(e.getFileId()));
e.setLabels(fileTagRelationService.getFileTags(e.getId()));
});
UserThreadLocal.setSuccessInfo("", "", "查询文件成功");
return ElectromagneticResultUtil.success(new RespPageVO<>(total, records));
@ -1077,7 +1077,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
User singleUser = userMapper.getSingleUser(fileInfo.getCreatedBy());
fileInfo.setCreatedBy(singleUser.getUserName());
FileInfoVO fileInfoVO = BeanUtil.copyProperties(fileInfo, FileInfoVO.class);
fileInfoVO.setLabels(fileTagRelationService.getFileTags(fileInfo.getFileId()));
UserThreadLocal.setSuccessInfo(fileInfo.getParentId(), id, "查询了文件的详细信息");
return ElectromagneticResultUtil.success(fileInfoVO);
}
@ -1464,13 +1463,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
fileInfoVOIPage.getRecords().forEach(e -> {
e.setFileSizeShow(EleCommonUtil.convertFileSize(e.getFileSize()));
e.setIsFavorite(isFavorite(UserThreadLocal.getUserId(), e.getId()) ? 1 : 0);
if (String.valueOf(DataOwnEnum.REPO_FILE.code).equals(e.getDataOwn())) {
e.setIsPersonal(2);
} else if (String.valueOf(DataOwnEnum.USER_FILE.code).equals(e.getDataOwn()) && Objects.equals(e.getCreatedBy(), UserThreadLocal.getUserId())) {
e.setIsPersonal(1);
} else {
e.setIsPersonal(0);
}
e.setIsPersonal((String.valueOf(DataOwnEnum.USER_FILE.code).equals(e.getDataOwn()) && Objects.equals(e.getCreatedBy(), UserThreadLocal.getUserId())) ? 1 : 0);
// 设置权限
Map<String, Boolean> permissions = (e.getIsPersonal() == 1)
? permissionService.getPersonalPermission()