From bd3b677e900f7bf724fc72e5c12501c1e50442f1 Mon Sep 17 00:00:00 2001 From: zhengyf <zyf654042662@163.com> Date: Fri, 1 Nov 2024 13:46:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BD=E7=9F=A5:=E9=92=89=E9=92=89=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lets/dingtalk/push/serivce/impl/PushU8CServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dingtalk/push/serivce/impl/PushU8CServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dingtalk/push/serivce/impl/PushU8CServiceImpl.java index 6c41e648..36d19136 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dingtalk/push/serivce/impl/PushU8CServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dingtalk/push/serivce/impl/PushU8CServiceImpl.java @@ -217,10 +217,13 @@ public class PushU8CServiceImpl implements PushU8CService { List<FileModuleVO> fileModuleVOList = new ArrayList<>(); for (SysFileVO fileVO : fileVOS) { // 指定输出文件路径 - Path outputPath = Paths.get(fileVO.getFileName() + "." + fileVO.getType()); + Path outputPath = Paths.get("D:\\ding-file\\"+fileVO.getFileName()); // 1. 解码Base64字符串并写入文件 byte[] decodedBytes = Base64.getDecoder().decode(fileVO.getBaseCode()); Files.write(outputPath, decodedBytes); + // 获取文件大小 + String fileSizeInBytes = String.valueOf(Files.size(outputPath)); + fileVO.setFileSize(fileSizeInBytes); logger.info("文件已成功创建: " + outputPath); // 2. 将文件内容读取到ByteArrayOutputStream ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();