From 06ba42d0d1812851ae65a5a0733fb3cd786ed00f Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 29 Apr 2022 11:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FileUploadServiceImpl.java | 55 +++++-------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java index 90b5455..c5f24e2 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java @@ -229,46 +229,6 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp } } - /*List fileUploadDTOList = fileUploadDao.list(params); - if(null != fileUploadDTOList && fileUploadDTOList.size() > 0) { - Iterator it = fileUploadDTOList.iterator(); - while(it.hasNext()) { - FileUploadDTO fileUploadDTO = (FileUploadDTO) it.next(); - params.put("fileTypeId", fileUploadDTO.getFileTypeId()); - params.put("fileUploadId", fileUploadDTO.getFileUploadId()); - String typeBelong = null; - if(null != params.get("typeBelong")) { - typeBelong = params.get("typeBelong").toString(); - if("共享文档".equals(typeBelong)) { - typeBelong = "个人文档"; - } - } - if(null != params.get("typeBelong") && "共享文档".equals(params.get("typeBelong").toString())) { - List fileRoleDTOList = fileTypeService.getShare(params); - if(null == fileRoleDTOList || fileRoleDTOList.size() == 0) { - it.remove(); - continue; - } - } - params.remove("typeBelong"); - params.remove("creator"); - FileTypeDTO fileTypeDTO = fileTypeService.get(params); - params.put("typeBelong", typeBelong); - if(null != params.get("typeBelong") && null != fileTypeDTO) { - if(!params.get("typeBelong").toString().equals(fileTypeDTO.getTypeBelong())) { - it.remove(); - continue; - } - } - - - FileTypeDTO fileTypeDTO1 = fileTypeService.getName(fileUploadDTO.getFileTypeId()); - if(null != fileTypeDTO1) { - fileUploadDTO.setCatalogueType(fileTypeDTO1.getTypeBelong()); - fileUploadDTO.setCatalogueName(fileTypeDTO1.getTypeName()); - } - } - }*/ // 新逻辑 List fileUploadDTOList = null; if(null != params.get("typeBelong")) { @@ -287,6 +247,7 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp if(null != fileTypeDTO && "公共文档".equals(fileTypeDTO.getTypeBelong())) { iterator.remove(); } + fileUploadDTO.setCatalogueId(fileTypeDTO.getFileTypeId()); fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); } @@ -317,6 +278,7 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp params.remove("creator"); FileTypeDTO fileTypeDTO = fileTypeService.get(params); if(null != fileTypeDTO) { + fileUploadDTO.setCatalogueId(fileTypeDTO.getFileTypeId()); fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); } @@ -343,6 +305,7 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp continue; } if(null != fileTypeDTO) { + fileUploadDTO.setCatalogueId(fileTypeDTO.getFileTypeId()); fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); } @@ -377,6 +340,18 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp } } + if(null != fileUploadDTOList && fileUploadDTOList.size() > 0) { + Iterator it = fileUploadDTOList.iterator(); + String fileTypeId = null == params.get("cataId") ? null : params.get("cataId").toString(); + while (it.hasNext() && null != fileTypeId) { + FileUploadDTO fileUploadDTO = it.next(); + if(!fileTypeId.equals(fileUploadDTO.getFileTypeId())) { + it.remove(); + } + } + } + + return fileUploadDTOList; }