| | |
| | | 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.domain.po.FileRelate; |
| | | 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.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return fileForCatListDTOList; |
| | | } |
| | | |
| | | /** |
| | | * 根据编号删除附件 |
| | | * @param id 附件编号 |
| | | */ |
| | | public void deleteFileById(String id) { |
| | | try{ |
| | | // 删除关系表 |
| | | QueryWrapper<FileRelate> fileRelateQueryWrapper = new QueryWrapper<>(); |
| | | fileRelateQueryWrapper.eq("file_id", id); |
| | | fileRelateService.remove(fileRelateQueryWrapper); |
| | | // 删除附件信息表 |
| | | mapper.deleteById(id); |
| | | // 删除ftp文件 |
| | | }catch (Exception e){ |
| | | log.error("service方法[FileInfoService.deleteFileById]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileInfoService.deleteFileById", e); |
| | | } |
| | | } |
| | | |
| | | } |