Compare commits
2 Commits
bea84f57c2
...
5fd43452de
| Author | SHA1 | Date |
|---|---|---|
|
|
5fd43452de | |
|
|
d9ffa2438d |
|
|
@ -86,6 +86,7 @@ public class FileRecycleServiceImpl implements FileRecycleService {
|
||||||
.orderByAsc(ObjUtil.equals(pars.getFileTypeSort(), 0), EdFileInfo::getSort)
|
.orderByAsc(ObjUtil.equals(pars.getFileTypeSort(), 0), EdFileInfo::getSort)
|
||||||
.orderByDesc(ObjUtil.equals(pars.getFileTypeSort(), 1), EdFileInfo::getSort);
|
.orderByDesc(ObjUtil.equals(pars.getFileTypeSort(), 1), EdFileInfo::getSort);
|
||||||
|
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(pars.getKeyword())) {
|
if (StrUtil.isNotEmpty(pars.getKeyword())) {
|
||||||
queryWrapper.and(qr -> qr.like(EdFileInfo::getFileName, pars.getKeyword())
|
queryWrapper.and(qr -> qr.like(EdFileInfo::getFileName, pars.getKeyword())
|
||||||
.or()
|
.or()
|
||||||
|
|
@ -95,17 +96,18 @@ public class FileRecycleServiceImpl implements FileRecycleService {
|
||||||
.or()
|
.or()
|
||||||
.like(EdFileInfo::getFileContent, pars.getKeyword()));
|
.like(EdFileInfo::getFileContent, pars.getKeyword()));
|
||||||
}
|
}
|
||||||
// TODO 要考虑数据是个人数据还是库数据,如果是管理员,则展示全部数据,其他用户则展示有权限的系统数据+用户个人数据+库数据
|
|
||||||
if (!UserThreadLocal.getAdminType().equals(AdminTypeEnum.SYSTEM.getValue())) {
|
|
||||||
List<String> accessibleTree = permissionService.getAccessibleTree();
|
|
||||||
queryWrapper.and(qr -> qr.eq(EdFileInfo::getCreatedBy, UserThreadLocal.getUserId()).eq(EdFileInfo::getDataOwn, DataOwnEnum.USER_FILE.code));
|
|
||||||
if (CollUtil.isNotEmpty(accessibleTree)) {
|
|
||||||
for (String permission : accessibleTree) {
|
|
||||||
queryWrapper.or().likeRight(EdFileInfo::getFileCode, permission);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!UserThreadLocal.getAdminType().equals(AdminTypeEnum.SYSTEM.getValue())) {
|
||||||
|
List<String> ids = edFileInfoMapper.selectList(Wrappers.<EdFileInfo>lambdaQuery().select(EdFileInfo::getId).eq(EdFileInfo::getDataOwn, DataOwnEnum.USER_FILE.code))
|
||||||
|
.stream()
|
||||||
|
.map(EdFileInfo::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<String> accessibleTree = permissionService.getAccessibleTree();
|
||||||
|
accessibleTree.addAll(ids);
|
||||||
|
if (CollUtil.isNotEmpty(accessibleTree)) {
|
||||||
|
queryWrapper.and(qr -> accessibleTree.forEach(e -> qr.or().likeRight(EdFileInfo::getFilePath, e)));
|
||||||
|
}
|
||||||
|
}
|
||||||
Page<EdFileInfo> edFileInfoPage = this.edFileInfoMapper.selectPage(new Page<>(pars.getPageNum(), pars.getPageSize()), queryWrapper);
|
Page<EdFileInfo> edFileInfoPage = this.edFileInfoMapper.selectPage(new Page<>(pars.getPageNum(), pars.getPageSize()), queryWrapper);
|
||||||
long total = edFileInfoPage.getTotal();
|
long total = edFileInfoPage.getTotal();
|
||||||
List<FileRecycleQueryVO> records = BeanUtil.copyToList(edFileInfoPage.getRecords(), FileRecycleQueryVO.class);
|
List<FileRecycleQueryVO> records = BeanUtil.copyToList(edFileInfoPage.getRecords(), FileRecycleQueryVO.class);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue