bug修改。

This commit is contained in:
Renpc-kilig 2023-02-17 18:03:07 +08:00
parent 9cf48abc5a
commit d1cde06e49

View File

@ -359,7 +359,7 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp
if("公共文档".equals(typeBelong)) {
params.remove("creator");
List<FileUploadDTO> list = fileUploadDao.list(params);
if(null != list && list.size() > 0) {
if (null != list && list.size() > 0) {
Iterator<FileUploadDTO> iterator = list.iterator();
while (iterator.hasNext()) {
FileUploadDTO fileUploadDTO = iterator.next();
@ -371,18 +371,18 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp
FileCatalogueDTO fileCatalogueDTO = fileCatalogueService.get(params);
// 若文档类型创建者和当前登录用户一致则授权操作权限
if(creator.equals(fileCatalogueDTO.getCreator())) {
if (creator.equals(fileCatalogueDTO.getCreator())) {
fileUploadDTO.setOperationRole("1");
}else {
} else {
// 获取操作权限
params.put("fileCatalogueId", fileCatalogueDTO.getFileCatalogueId());
if(typeRoleService.hasRole(params)) {
if (typeRoleService.hasRole(params)) {
fileUploadDTO.setOperationRole("1");
}
}
// 若文档类型不是公共文档则移除数据
if(null != fileCatalogueDTO) {
if (null != fileCatalogueDTO) {
if (!"1".equals(fileCatalogueDTO.getType())) {
iterator.remove();
continue;
@ -416,13 +416,13 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp
fileUploadDTO.setCatalogueType("公共文档");
}
fileUploadDTOList.addAll(list);
}else {
} else if (null == token) {
fileUploadDTOList = new ArrayList<>();
FileUploadDTO fileUploadDTO = new FileUploadDTO();
fileUploadDTO.setOperationRole("0");
FileCatalogueDTO fileCatalogueDTO = fileCatalogueService.get(params.get("fileTypeId").toString());
// 若文档类型创建者和当前登录用户一致则授权操作权限
if(null != fileCatalogueDTO) {
if (null != fileCatalogueDTO) {
if (creator.equals(fileCatalogueDTO.getCreator())) {
fileUploadDTO.setOperationRole("1");
} else {
@ -436,13 +436,14 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp
fileUploadDTOList.add(fileUploadDTO);
}
if(null == fileUploadDTOList || fileUploadDTOList.size() < 1) {
if (null == token) {
if (null == fileUploadDTOList || fileUploadDTOList.size() < 1) {
fileUploadDTOList = new ArrayList<>();
FileUploadDTO fileUploadDTO = new FileUploadDTO();
fileUploadDTO.setOperationRole("0");
FileCatalogueDTO fileCatalogueDTO = fileCatalogueService.get(params.get("fileTypeId").toString());
// 若文档类型创建者和当前登录用户一致则授权操作权限
if(null != fileCatalogueDTO) {
if (null != fileCatalogueDTO) {
if (creator.equals(fileCatalogueDTO.getCreator())) {
fileUploadDTO.setOperationRole("1");
} else {
@ -456,6 +457,7 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp
fileUploadDTOList.add(fileUploadDTO);
}
}
}
if("共享文档".equals(typeBelong)) {
String fileUploadIds = null == params.get("fileUploadId") ? null: params.get("fileUploadId").toString();