fix 项目管理-shangchuan

This commit is contained in:
renzexin 2024-08-15 16:52:11 +08:00
parent e77cd63ae0
commit e6e997b179
2 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,11 @@
package com.chushang.oss.entity.vo;
import lombok.Data;
@Data
public class FileVo {
private String fid;
private String mimeType;
private String realPath;
private String fileName;
}

View File

@ -23,6 +23,7 @@ import com.chushang.oss.config.UploadConfig;
import com.chushang.oss.entity.FileSourceInfo; import com.chushang.oss.entity.FileSourceInfo;
import com.chushang.oss.entity.dto.OcrDTO; import com.chushang.oss.entity.dto.OcrDTO;
import com.chushang.oss.entity.vo.FileSourceVo; import com.chushang.oss.entity.vo.FileSourceVo;
import com.chushang.oss.entity.vo.FileVo;
import com.chushang.oss.enums.OcrTypeEnum; import com.chushang.oss.enums.OcrTypeEnum;
import com.chushang.oss.mapper.FileSourceMapper; import com.chushang.oss.mapper.FileSourceMapper;
import com.chushang.security.utils.SecurityUtils; import com.chushang.security.utils.SecurityUtils;
@ -253,7 +254,7 @@ public class FileSourceService
return upload; return upload;
} }
public String uploadContract(MultipartFile file) throws Exception public FileVo uploadContract(MultipartFile file) throws Exception
{ {
String ip = IPUtils.clientIp(ServletUtils.getRequest()); String ip = IPUtils.clientIp(ServletUtils.getRequest());
String fid = generateFid(); String fid = generateFid();
@ -284,7 +285,12 @@ public class FileSourceService
String upload = ossService.upload(file.getInputStream(), fileSourceInfo); String upload = ossService.upload(file.getInputStream(), fileSourceInfo);
fileSourceInfo.setRealPath(upload); fileSourceInfo.setRealPath(upload);
save(fileSourceInfo); save(fileSourceInfo);
return upload; FileVo fileVo = new FileVo();
fileVo.setRealPath(upload);
fileVo.setFid(fid);
fileVo.setMimeType(mimetype);
fileVo.setFileName(fName);
return fileVo;
} }
public FileSourceVo addFile(byte[] bytes, String fileName, Boolean sealFlag, String formats, String fileType) public FileSourceVo addFile(byte[] bytes, String fileName, Boolean sealFlag, String formats, String fileType)