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