|
@@ -41,6 +41,12 @@ public class FileManagerService {
|
|
|
@Value("${FMSUrl}")
|
|
|
private String FMSUrl;
|
|
|
|
|
|
+ /**
|
|
|
+ * 调用文件系统上传文件接口
|
|
|
+ *
|
|
|
+ * @param multipartFiles 文件
|
|
|
+ * @param sourceId 来源配置id(1本地服务器分析系统文件 2本地服务器报告系统文件 3生产服务器分析系统文件 4生产服务器报告系统文件)
|
|
|
+ */
|
|
|
public String uploadFile(List<MultipartFile> multipartFiles, Integer sourceId) throws IOException {
|
|
|
List<File> files = new ArrayList<>();
|
|
|
for (MultipartFile multipartFile : multipartFiles) {
|
|
@@ -70,7 +76,7 @@ public class FileManagerService {
|
|
|
Response response = null;
|
|
|
response = okHttpClient.newCall(request).execute();
|
|
|
// 最后记得删除临时文件
|
|
|
- for(File file:files){
|
|
|
+ for (File file : files) {
|
|
|
FileUtils.deleteQuietly(file);
|
|
|
}
|
|
|
return Objects.requireNonNull(response.body()).string();
|
|
@@ -97,8 +103,7 @@ public class FileManagerService {
|
|
|
/**
|
|
|
* 调用文件系统获取文件信息接口
|
|
|
*
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
+ * @param fileIds 文件ids
|
|
|
*/
|
|
|
public String getSystemFileFromFMS(List<Integer> fileIds) throws IOException {
|
|
|
String param = new Gson().toJson(fileIds);
|
|
@@ -116,10 +121,9 @@ public class FileManagerService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 调用文件系统删除接口
|
|
|
+ * 调用文件系统删除文件接口
|
|
|
*
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
+ * @param fmsDeleteFileDTO 需要删除的文件ids和删除类型
|
|
|
*/
|
|
|
public String deleteFileFromFMS(FMSDeleteFileDTO fmsDeleteFileDTO) throws IOException {
|
|
|
String param = new Gson().toJson(fmsDeleteFileDTO);
|