lighter 1 year ago
parent
commit
d6f1de6bcc

+ 1 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiDownloadService.java

@@ -1041,7 +1041,7 @@ public class SiDownloadService {
         fsDownloadIn.put("filename", filename);
         fsDownloadIn.put("fixmedins_code", SiUtil.INSTITUTION_ID);
         input.getJSONObject("input").put("fsDownloadIn", fsDownloadIn);
-        String targetPath = "/home/web-server/temp/" + filename;
+        String targetPath = ZipUtil.DIRECTORY + filename;
         ForestResponse<byte[]> rsp = execSrvc.download(SiUtil.getSiHeaderMap(SiFunction.DOWNLOAD_FILE), input);
         try {
             Files.write(Paths.get(targetPath), Objects.requireNonNull(rsp.getByteArray(),

+ 2 - 1
src/main/java/thyyxxk/webserver/utils/ZipUtil.java

@@ -16,6 +16,7 @@ import java.util.zip.ZipOutputStream;
  */
 @Slf4j
 public class ZipUtil {
+    public static final String DIRECTORY = "/home/web-server/temp/";
 
     /**
      * zip压缩
@@ -55,7 +56,7 @@ public class ZipUtil {
         while((entry = in.getNextEntry()) != null){
             if(!entry.isDirectory()){
                 //文件输出流
-                unZipPath = "/home/web-server/temp/"+entry.getName();
+                unZipPath = DIRECTORY + entry.getName();
                 FileOutputStream out = new FileOutputStream(unZipPath);
                 BufferedOutputStream bos = new BufferedOutputStream(out);
                 int len;