From b7341750a0d77c0f829400fb2b3c33311fb10516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Thu, 7 Mar 2024 15:34:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=8B=86=E5=88=86--=E6=9F=A5=E7=9C=8B--=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E7=9B=AE=E5=BD=95--=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/components/tools/Logo.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jero-web/src/components/tools/Logo.vue b/jero-web/src/components/tools/Logo.vue index 7c8b558..bcd5c04 100644 --- a/jero-web/src/components/tools/Logo.vue +++ b/jero-web/src/components/tools/Logo.vue @@ -6,8 +6,8 @@ - 拆分对比工具 - 拆分对比工具 + 拆分比对工具 + 拆分比对工具 From baa34c8d65a8dc1ce61ce7cfa254077970432b6f Mon Sep 17 00:00:00 2001 From: wangzhijiang <1358525938@qq.com> Date: Thu, 7 Mar 2024 15:45:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=BC=96=E8=BE=91-?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9F=BA=E7=BA=BF=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OnlyOfficeController.java | 73 ++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) 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 0e03659..e6e3de0 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 @@ -1,6 +1,7 @@ package com.jero.modules.onlyoffice.controller; import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -21,7 +22,9 @@ import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,6 +42,8 @@ import java.net.URL; import java.net.URLConnection; import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; +import java.time.Duration; +import java.time.Instant; import java.util.*; /** @@ -369,7 +374,11 @@ public class OnlyOfficeController { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(OnlineFileLog::getHisId, fileId); - wrapper.eq(OnlineFileLog::getDataType, dataType); + if (StringUtils.equals(dataType,"0")) { + wrapper.isNull(OnlineFileLog::getDataType); + } else if (StringUtils.equals(dataType,"1")) { + wrapper.eq(OnlineFileLog::getDataType, dataType); + } wrapper.eq(OnlineFileLog::getValidFlag, "0"); wrapper.orderByDesc(OnlineFileLog::getCreateTime); List onlineFileLogList = onlineFileLogDao.selectList(wrapper); @@ -486,5 +495,67 @@ public class OnlyOfficeController { } return fileName; } + @ApiOperation(value = "更新基线信息") + @PostMapping("/updateOnlineFileLogJxInfo") + public Result updateOnlineFileLogJxInfo(@RequestBody JSONObject json){ + String jxFileName = json.getString("jxFileName"); + String fileId = json.getString("fileId"); + String dataType = "1"; + + Date now = new Date(); + OnlineFileLog createTimeLatestOnlineFileLog = this.getCreateTimeLatestOnlineFileLog(fileId,now); + createTimeLatestOnlineFileLog.setJxFileName(jxFileName); + createTimeLatestOnlineFileLog.setDataType(dataType); + + this.onlineFileLogDao.updateById(createTimeLatestOnlineFileLog); + return Result.OK(); + } + + /** + * 获取在线编辑文件保存历史,更新基线信息使用。 + * @return + */ + public OnlineFileLog getCreateTimeLatestOnlineFileLog(String fileId,Date now){ + QueryWrapper ofLogQueryWrap = new QueryWrapper<>(); + ofLogQueryWrap.lambda().eq(OnlineFileLog::getHisId,fileId); + ofLogQueryWrap.lambda().orderByDesc(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.isEmpty(result)){ + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + result = this.getCreateTimeLatestOnlineFileLog(fileId,now); + } + return result; + } } From 3f3594c06c4aae76ffd63e0b8cc096d3160d937e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Thu, 7 Mar 2024 16:14:43 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9F=BA=E7=BA=BF?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jero/modules/onlyoffice/service/LawsUserInfoService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/LawsUserInfoService.java b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/LawsUserInfoService.java index e070954..a27202b 100644 --- a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/LawsUserInfoService.java +++ b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/LawsUserInfoService.java @@ -111,8 +111,8 @@ public class LawsUserInfoService { onlineFileLog.setValidFlag("0"); onlineFileLog.setFileKey(key); onlineFileLog.setFilePath(fileUrl); - onlineFileLog.setDataType(dataType); - onlineFileLog.setJxFileName(jxFileName); +// onlineFileLog.setDataType(dataType); +// onlineFileLog.setJxFileName(jxFileName); onlineFileLogDao.insert(onlineFileLog); log.info("======================日志存入成功==============================="); if (StringUtils.isNotBlank(standName)) { @@ -121,6 +121,7 @@ public class LawsUserInfoService { log.info("======================文件名称修改成功===============================" + standName + ".docx" + "======" + "传入对象为:" + ossFile.getFileName()); } QueryWrapper onlineFileLogQueryWrapperHis = new QueryWrapper<>(); + onlineFileLogQueryWrapperHis.isNull("DATA_TYPE"); onlineFileLogQueryWrapperHis.eq("HIS_ID", onlineFileId); onlineFileLogQueryWrapperHis.eq("VALID_FLAG", "0"); onlineFileLogQueryWrapperHis.orderByAsc("CREATE_TIME"); 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 4/4] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=BC=96=E8=BE=91-?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9F=BA=E7=BA=BF=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=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 {