| | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.constant.BaseConsts; |
| | | import cn.huge.module.file.dao.mapper.FileInfoMapper; |
| | | import cn.huge.module.file.domain.dto.FileForCatDTO; |
| | | import cn.huge.module.file.domain.dto.FileForCatListDTO; |
| | | import cn.huge.module.file.domain.dto.UploaderDTO; |
| | | import cn.huge.module.file.domain.po.FileInfo; |
| | | import cn.huge.module.file.utils.FtpUtils; |
| | | import cn.huge.module.file.utils.FtpMultipartFileWrapper; |
| | | import cn.huge.module.sys.constant.FileOwnerTypeBaseEnum; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @title: 附件信息表业务逻辑处理 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查看附件组件-分类查询附件 |
| | | * @param terms |
| | | * @return |
| | | */ |
| | | public List<FileForCatListDTO> webListFileByCat(Map<String, Object> terms){ |
| | | List<FileForCatListDTO> fileForCatListDTOList = new ArrayList<>(); |
| | | // 查询附件信息进行封装 |
| | | List<FileForCatDTO> oldFileForCatDTOList = mapper.listFileByCatTerms(terms); |
| | | if (CollectionUtils.isNotEmpty(oldFileForCatDTOList)) { |
| | | Set<String> setTmp = new HashSet<>(); |
| | | for (FileForCatDTO fileForCatDTO: oldFileForCatDTOList) { |
| | | if (ObjectUtils.isNotEmpty(fileForCatDTO.getOwnerCat())) { |
| | | setTmp.add(fileForCatDTO.getOwnerCat()); |
| | | } |
| | | } |
| | | Iterator<String> it = setTmp.iterator(); |
| | | while (it.hasNext()) { |
| | | String ownerCat = it.next(); |
| | | FileForCatListDTO fileForCatListDTO = new FileForCatListDTO(); |
| | | fileForCatListDTO.setOwnerCat(ownerCat); |
| | | fileForCatListDTO.setOwnerCatName(FileOwnerTypeBaseEnum.getDes(ownerCat)); |
| | | List<FileForCatDTO> newFileForCatDTOS = new ArrayList<>(); |
| | | for (FileForCatDTO fileForCatDTO : oldFileForCatDTOList) { |
| | | if (ownerCat.equals(fileForCatDTO.getOwnerCat())) { |
| | | newFileForCatDTOS.add(fileForCatDTO); |
| | | } |
| | | } |
| | | fileForCatListDTO.setFileList(newFileForCatDTOS); |
| | | fileForCatListDTO.setFileSize(newFileForCatDTOS.size()); |
| | | fileForCatListDTOList.add(fileForCatListDTO); |
| | | } |
| | | } |
| | | return fileForCatListDTOList; |
| | | } |
| | | |
| | | } |