diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index c91fd61..e54fb24 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -155,7 +155,7 @@ public class TRecordController extends BaseController exportInfo.add(map); }); } - response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); +// response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); try { // FileUtils.setAttachmentResponseHeader(response, "舌面舌下图片下载"); // FileUtils.urlResourceWriteBytes(exportInfo, response.getOutputStream()); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index c43f430..c48d6bf 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -163,11 +163,12 @@ public class FileUtils bufIn = new BufferedInputStream(file.openStream()); zipEntry = new ZipEntry(filePath.get("downloadPath").toString()); zipOutputStream.putNextEntry(zipEntry); - int length = 0; - while ((length = bufIn.read()) != -1) - { - zipOutputStream.write(length); - } +// int length = 0; +// while ((length = bufIn.read()) != -1) +// { +// zipOutputStream.write(length); +// } + IOUtils.copy(bufIn,zipOutputStream); } } catch (IOException e) @@ -213,12 +214,13 @@ public class FileUtils bufIn = new BufferedInputStream(file.openStream()); zipEntry = new ZipEntry(filePath.get("downloadPath").toString()); zipOutputStream.putNextEntry(zipEntry); - byte[] b = new byte[1024*4]; - int length; - while ((length = bufIn.read(b)) > 0) - { - zipOutputStream.write(b, 0, length); - } +// byte[] b = new byte[1024*4]; +// int length; +// while ((length = bufIn.read(b)) > 0) +// { +// zipOutputStream.write(b, 0, length); +// } + IOUtils.copy(bufIn,zipOutputStream); } } catch (IOException e) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TDownloadZip.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TDownloadZip.java index a0cb053..cf684da 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TDownloadZip.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TDownloadZip.java @@ -1,6 +1,6 @@ package com.ruoyi.system.domain; -import com.ruoyi.common.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -42,6 +42,7 @@ public class TDownloadZip extends BaseEntity /** 创建时间 */ @ApiModelProperty("创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; public void setId(Long id) {