Compare commits
2 Commits
bea84f57c2
...
5fd43452de
| Author | SHA1 | Date |
|---|---|---|
|
|
5fd43452de | |
|
|
d9ffa2438d |
|
|
@ -101,7 +101,7 @@ public class UserController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @RequiredRole(AdminTypeEnum.SYSTEM)
|
// @RequiredRole(AdminTypeEnum.SYSTEM)
|
||||||
@PutMapping("/changePassword")
|
@PutMapping("/changePassword")
|
||||||
@UserOperation(value = "修改用户密码", modelName = UserOperationModuleEnum.USER)
|
@UserOperation(value = "修改用户密码", modelName = UserOperationModuleEnum.USER)
|
||||||
public ElectromagneticResult<?> changePassword(@RequestBody ChangePasswordRequest request) {
|
public ElectromagneticResult<?> changePassword(@RequestBody ChangePasswordRequest request) {
|
||||||
|
|
|
||||||
|
|
@ -1463,7 +1463,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
fileInfoVOIPage.getRecords().forEach(e -> {
|
fileInfoVOIPage.getRecords().forEach(e -> {
|
||||||
e.setFileSizeShow(EleCommonUtil.convertFileSize(e.getFileSize()));
|
e.setFileSizeShow(EleCommonUtil.convertFileSize(e.getFileSize()));
|
||||||
e.setIsFavorite(isFavorite(UserThreadLocal.getUserId(), e.getId()) ? 1 : 0);
|
e.setIsFavorite(isFavorite(UserThreadLocal.getUserId(), e.getId()) ? 1 : 0);
|
||||||
e.setIsPersonal( (String.valueOf(DataOwnEnum.USER_FILE.code).equals(e.getDataOwn()) && Objects.equals(e.getCreatedBy(), UserThreadLocal.getUserId())) ? 1 : 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)
|
Map<String, Boolean> permissions = (e.getIsPersonal() == 1)
|
||||||
? permissionService.getPersonalPermission()
|
? permissionService.getPersonalPermission()
|
||||||
|
|
|
||||||
|
|
@ -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