| | |
| | | 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; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | } |
| | | |
| | | private String getFilePath(String sysCode) { |
| | | return sysCode.concat(StringUtils.SLASH).concat(StringUtils.SLASH).concat(DateUtils.dateToDateString(new Date(),DateUtils.yyyyMMdd_EN)).concat(StringUtils.SLASH); |
| | | return sysCode.concat(StringUtils.SLASH).concat(DateUtils.dateToDateString(new Date(),DateUtils.yyyyMMdd_EN)).concat(StringUtils.SLASH); |
| | | } |
| | | |
| | | public void storageFile(MultipartFile file, String originalFilename, String targetFolder) { |
| | |
| | | }); |
| | | 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; |
| | | } |
| | | } |