Browse Source

modify:

1. 信产文件下载临时目录修改;
tags/24092002^0
WendyYang 3 months ago
parent
commit
adae16140c
2 changed files with 4 additions and 5 deletions
  1. +3
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/QxProjectController.java

+ 3
- 4
hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java View File

@@ -1,11 +1,10 @@
package com.hz.pm.api.external;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
@@ -21,7 +20,6 @@ import org.springframework.stereotype.Component;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.Arrays;
import java.util.Collections;
@@ -76,7 +74,8 @@ public class MhFileClient {
try {
List<MhFileInfoDTO> files = listFileInfo(fileId);
MhFileInfoDTO file = files.get(0);
String tmpFilePath = FileUtil.getTmpDirPath() + file.getFileName() + "." + file.getFileSuffix();
String tmpDirPath = StrUtil.appendIfMissing(FileUtil.getTmpDirPath(), "/");
String tmpFilePath = tmpDirPath + file.getFileName() + "." + file.getFileSuffix();
File tmpFile = new File(tmpFilePath);
long size = HttpUtil.downloadFile(fileUrl, tmpFile);
log.info("下载文件:{},大小为:{}", fileId, size);


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/QxProjectController.java View File

@@ -81,7 +81,7 @@ public class QxProjectController {
return qxProjectManage.listReplaceInfo(projectId);
}

@PostMapping("importProject")
@PostMapping("/importProject")
@ApiOperation("导入项目")
@PreAuthorize("hasAuthority('SUPER_ADMIN')")
public void importProject(MultipartFile file) {


Loading…
Cancel
Save