| | |
| | | package com.moral.api.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.moral.api.config.Interceptor.UserHelper; |
| | | import com.moral.api.entity.FileTable; |
| | | import com.moral.api.exception.BusinessException; |
| | | import com.moral.api.mapper.FileTableMapper; |
| | | import com.moral.api.pojo.enums.FileType; |
| | | import com.moral.api.pojo.enums.YesOrNo; |
| | | import com.moral.api.pojo.vo.file.FileAddressVo; |
| | | import com.moral.api.pojo.vo.file.FileVo; |
| | | import com.moral.api.pojo.vo.user.QxUser; |
| | | import com.moral.api.service.FileTableService; |
| | |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<FileAddressVo> list(int relationId, int fileModule, int fileType) { |
| | | List<FileAddressVo> list = new ArrayList<>(); |
| | | List<FileTable> existsList = this.lambdaQuery().eq(FileTable::getRelationId, relationId) |
| | | .eq(FileTable::getFileModule, fileModule) |
| | | .eq(Objects.nonNull(fileType),FileTable::getFileType,fileType) |
| | | .eq(FileTable::getIsDel, YesOrNo.NO.value).orderByAsc(FileTable::getCreateTime).list(); |
| | | existsList.forEach(it->{ |
| | | FileAddressVo fileVo = new FileAddressVo(); |
| | | fileVo.setFileId(it.getFileId()); |
| | | fileVo.setFileName(it.getFileName()); |
| | | fileVo.setFileType(it.getFileType()); |
| | | fileVo.setFileAddress(it.getFileAddress()); |
| | | list.add(fileVo); |
| | | }); |
| | | return list; |
| | | } |
| | | } |