From 320a236582f99f5ad5fc95c575b4d913c7604c19 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Tue, 24 Sep 2024 11:49:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AE=A1=E8=AE=A1=E6=97=A5=E5=BF=97=E5=A4=87?= =?UTF-8?q?=E4=BB=BD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/system/service/impl/AuditServiceImpl.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java index 0bc1b4bf3..35972e90a 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java @@ -241,13 +241,7 @@ public class AuditServiceImpl extends ServiceImpl implem //计算一般情况下每一个Sheet需要写入的次数(一般情况不包含最后一个sheet,因为最后一个sheet不确定会写入多少条数据) int oneSheetWriteCount = sheetDataRows / writeDataRows; //计算最后一个sheet需要写入的次数 - int lastSheetWriteCount; - if (totalCount > sheetDataRows) { - lastSheetWriteCount = totalCount % sheetDataRows == 0 ? oneSheetWriteCount : (totalCount % sheetDataRows % writeDataRows == 0 ? (totalCount / sheetDataRows / writeDataRows) : (totalCount / sheetDataRows / writeDataRows + 1)); - } else { - lastSheetWriteCount = totalCount % sheetDataRows == 0 ? oneSheetWriteCount : oneSheetWriteCount + 1; - } - + int lastSheetWriteCount = totalCount % sheetDataRows == 0 ? oneSheetWriteCount : (totalCount % sheetDataRows % writeDataRows == 0 ? (totalCount / sheetDataRows / writeDataRows) : (totalCount / sheetDataRows / writeDataRows + 1)); //开始分批查询分次写入 for (int i = 0; i < sheetNum; i++) { @@ -265,7 +259,7 @@ public class AuditServiceImpl extends ServiceImpl implem } } catch (Exception e) { - redisUtil.delete("recoverLogFile"); + redisUtil.delete("logFileWriter"); e.printStackTrace(); } finally { excelWriter.finish();