From 997da4fe6639e86b484b96c3f83de91af4c898e1 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Wed, 5 Jun 2024 18:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96BUG=20=E4=B8=89=E9=A1=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E4=BF=AE=E6=94=B9=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../depository/TextLibraryController.java | 15 +++++++++------ .../depository/impl/TextLibraryServiceImpl.java | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zcloud/controller/depository/TextLibraryController.java b/src/main/java/com/zcloud/controller/depository/TextLibraryController.java index 576832f..1178add 100644 --- a/src/main/java/com/zcloud/controller/depository/TextLibraryController.java +++ b/src/main/java/com/zcloud/controller/depository/TextLibraryController.java @@ -153,12 +153,15 @@ public class TextLibraryController extends BaseController { .filter(data -> dataList.stream() .noneMatch(craft -> StringUtils.equals(data.getString("CATEGORY_ID"), craft.getString("CATEGORY_ID")))) .collect(Collectors.toList()); - PageData data = resultList.get(0); - if (!ObjectUtil.isEmpty(data)) { - findChildren(craftList, data, resultList); - } - for (PageData pageData : varList) { - pageData.put("SPECIFICATION_TYPES", resultList); + + if(!CollectionUtils.isEmpty(resultList)) { + PageData data = resultList.get(0); + if (!ObjectUtil.isEmpty(data)) { + findChildren(craftList, data, resultList); + } + for (PageData pageData : varList) { + pageData.put("SPECIFICATION_TYPES", resultList); + } } map.put("varList", varList); map.put("page", page); diff --git a/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java index 3889663..3bc5beb 100644 --- a/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java +++ b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java @@ -163,7 +163,7 @@ public class TextLibraryServiceImpl implements TextLibraryService { String path = smb.saveFile(file[0]); condition.put("PATH", path); } - if (StringUtils.isNotBlank(condition.getString("BUS_TEXT_LIBRARY_ID")) && StringUtils.isEmpty(condition.getString("ISADD"))) { + if (StringUtils.isNotBlank(condition.getString("BUS_TEXT_LIBRARY_ID")) && StringUtils.equals(condition.getString("OPERATE"), "edit")) { // 保存历史文件 PageData entity = textlibraryMapper.findById(condition); condition.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH")));