From 3ccea17b507af0f9e7e3057da958ebd1936a8100 Mon Sep 17 00:00:00 2001 From: wangzhijiang <1358525938@qq.com> Date: Thu, 7 Mar 2024 16:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=BC=96=E8=BE=91-=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=9F=BA=E7=BA=BF=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OnlyOfficeController.java | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java index e6e3de0..f470876 100644 --- a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java +++ b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java @@ -518,34 +518,36 @@ public class OnlyOfficeController { public OnlineFileLog getCreateTimeLatestOnlineFileLog(String fileId,Date now){ QueryWrapper ofLogQueryWrap = new QueryWrapper<>(); ofLogQueryWrap.lambda().eq(OnlineFileLog::getHisId,fileId); - ofLogQueryWrap.lambda().orderByDesc(OnlineFileLog::getCreateTime); + ofLogQueryWrap.lambda().ge(OnlineFileLog::getCreateTime,now); + ofLogQueryWrap.lambda().orderByAsc(OnlineFileLog::getCreateTime); List onlineFileLogs = this.onlineFileLogDao.selectList(ofLogQueryWrap); OnlineFileLog result = null; if (CollectionUtils.isNotEmpty(onlineFileLogs)) { result = onlineFileLogs.get(0); } - if (ObjectUtils.isNotEmpty(result)) { - long nowTime = now.getTime(); - long createTime = result.getCreateTime().getTime(); - // 如果数据的创建时间大于当前时间,直接返回 - if (createTime > nowTime) { - return result; - } - - // 计算时间差 - long diff = Math.abs(nowTime - createTime); - - // 判断时间差是否小于等于10秒 - if (diff <= 10 * 1000) { - System.out.println("两个日期在十秒内"); - } else { - System.out.println("两个日期不在十秒内"); - - result = null; - } - } +// if (ObjectUtils.isNotEmpty(result)) { +// long nowTime = now.getTime(); +// long createTime = result.getCreateTime().getTime(); +// +// // 如果数据的创建时间大于当前时间,直接返回 +// if (createTime > nowTime) { +// return result; +// } +// +// // 计算时间差 +// long diff = Math.abs(nowTime - createTime); +// +// // 判断时间差是否小于等于10秒 +// if (diff <= 10 * 1000) { +// System.out.println("两个日期在十秒内"); +// } else { +// System.out.println("两个日期不在十秒内"); +// +// result = null; +// } +// } if (ObjectUtils.isEmpty(result)){ try {