maven
2 天以前 8a106aa50cd79e1294166aefe01508281a41bd27
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -124,7 +124,8 @@
        // 3.查询上传文件
        LambdaQueryWrapper<CommonFile> salesLedgerFileWrapper = new LambdaQueryWrapper<>();
        salesLedgerFileWrapper.eq(CommonFile::getCommonId, salesLedger.getId());
        salesLedgerFileWrapper.eq(CommonFile::getCommonId, salesLedger.getId())
                .eq(CommonFile::getType, FileNameType.SALE.getValue());
        List<CommonFile> salesLedgerFiles = commonFileMapper.selectList(salesLedgerFileWrapper);
        // 4. 转换 DTO
@@ -480,13 +481,6 @@
            Path formalFilePath = formalDirPath.resolve(formalFilename);
            try {
                // 执行文件迁移(使用原子操作确保安全性)
//                Files.move(
//                        Paths.get(tempFile.getTempPath()),
//                        formalFilePath,
//                        StandardCopyOption.REPLACE_EXISTING,
//                        StandardCopyOption.ATOMIC_MOVE
//                );
                // 原子移动失败,使用复制+删除
                Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING);
                Files.deleteIfExists(Paths.get(tempFile.getTempPath()));