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 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();