diff --git a/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java b/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java index b9254aa8..8073123b 100644 --- a/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java +++ b/laws-modules/src/main/java/com/jero/modules/onlyoffice/controller/OnlyOfficeController.java @@ -49,6 +49,12 @@ public class OnlyOfficeController { @Resource private IOSSFileService ossFileService; + @ApiOperation(value = "|onlyOffice接收文件") + @PostMapping("/receiveFileBefore") + public void receiveFileBefore(HttpServletRequest request, HttpServletResponse response, String key, String fileNm, String standNo, String pid, String taskId, String standName) { + System.out.println("123"); + } + @ApiOperation(value = "onlyOffice接收文件") @PostMapping("/receiveFile") public void receiveFileBefore(HttpServletRequest request, HttpServletResponse response, String fileId, String fileNm) throws IOException { @@ -77,7 +83,9 @@ public class OnlyOfficeController { log.info("**********onlyoffice接收文档接口获得结果body************" + body); String downloadUri = (String) jsonObj.get("url"); + int saved = 0; if (StrUtil.isBlank(downloadUri)) { + writer.write("{\"error\":" + saved + "}"); return; } @@ -100,7 +108,7 @@ public class OnlyOfficeController { ossFile.setOnlId(dbFile.getOnlId()); ossFileService.updateById(ossFile); } - int saved = 0; + writer.write("{\"error\":" + saved + "}"); } catch (Exception e) { log.error("onlyOffice接收文档接口异常", e); @@ -149,7 +157,7 @@ public class OnlyOfficeController { public void downLoadFileRoma(@RequestParam(name = "id") String fileId, HttpServletResponse response) { OSSFile file = ossFileService.getById(fileId); if (file == null) { - log.error("文件不存在"); + log.error("文件不存在,文件Id: {}", fileId); throw new RuntimeException("文件不存在"); } response.reset(); @@ -205,9 +213,10 @@ public class OnlyOfficeController { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(OSSFile::getOnlId, file.getOnlId()); wrapper.orderByDesc(OSSFile::getCreateTime); - wrapper.last("limit 10"); + wrapper.last("limit 11"); List ossFileList = ossFileService.list(wrapper); if (!ossFileList.isEmpty()) { + ossFileList.remove(ossFileList.size() - 1); for (OSSFile ossFile : ossFileList) { Map map = new HashMap<>(); map.put("id", ossFile.getId());