教育训练处考试制证系统后端
huangzhen
2023-09-13 dca26f239eb286ff4333132f797d5cff39fb926e
文件增加批量保存功能
已修改3个文件
11 ■■■■■ 文件已修改
ruoyi-file/src/main/java/com/ruoyi/file/service/AttachmentService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-file/src/main/java/com/ruoyi/file/service/impl/AttachmentInfoServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-file/src/main/java/com/ruoyi/file/service/impl/AttachmentServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-file/src/main/java/com/ruoyi/file/service/AttachmentService.java
@@ -31,4 +31,6 @@
    void downloadForStream(HttpServletResponse response, String key);
    void downloadById(HttpServletResponse response, HttpServletRequest request, Long id);
    void saveBatch(List<AttachmentInfo> attachmentInfo);
}
ruoyi-file/src/main/java/com/ruoyi/file/service/impl/AttachmentInfoServiceImpl.java
@@ -58,7 +58,7 @@
        AttachmentInfo attachmentInfo = new AttachmentInfo();
        attachmentInfo.setId(id);
        attachmentInfo.setUpdateTime(new Date());
        //attachmentInfo.setUpdateBy(SecurityUtils.getUsername());
        attachmentInfo.setUpdateBy(SecurityUtils.getUsername());
        attachmentInfo.setDelFlag(1);
        attachmentInfoMapper.updateById(attachmentInfo);
    }
ruoyi-file/src/main/java/com/ruoyi/file/service/impl/AttachmentServiceImpl.java
@@ -401,4 +401,11 @@
            throw new ServiceException("文件不存在");
        }
    }
    @Override
    public void saveBatch(List<AttachmentInfo> attachmentInfo) {
        boolean saveBatch = attachmentInfoService.saveBatch(attachmentInfo);
        if (!saveBatch)
            throw new ServiceException("文件批量保存失败");
    }
}