From 5e132c7fa164107bc79853162425e32e82c25cb1 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Tue, 09 Aug 2022 15:38:48 +0800 Subject: [PATCH] fix:edit template path --- src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java index b064cc1..f31cef4 100644 --- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java +++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java @@ -1,5 +1,6 @@ package com.xcong.farmer.cms.modules.system.service.Impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.io.FileUtil; import com.xcong.farmer.cms.common.utils.FileUtils; @@ -76,7 +77,7 @@ releaseColumn(column.getParentId(), 1, companyId); } - if (beforeColumnId != null && !article.getColumnId().equals(beforeColumnId)) { + if (beforeColumnId != -1 && !article.getColumnId().equals(beforeColumnId)) { ColumnEntity beforeColumn = columnMapper.selectById(beforeColumnId); this.releaseColumn(beforeColumnId, 1, companyId); if (beforeColumn.getParentId() != 0L) { @@ -124,8 +125,10 @@ } if (article.getType() == 1) { - map.put("id", article.getId()); - cmsCoreService.articleProcess(map, columnEntity.getArticleTemplate(), columnEntity.getPath()); + Map<String, Object> articleMap = new HashMap<>(); + BeanUtil.copyProperties(map, articleMap); + articleMap.put("id", article.getId()); + cmsCoreService.articleProcess(articleMap, columnEntity.getArticleTemplate(), columnEntity.getPath()); } } } @@ -156,8 +159,10 @@ } if (article.getType() == 1) { - map.put("id", article.getId()); - cmsCoreService.articleProcess(map, column.getArticleTemplate(), column.getPath()); + Map<String, Object> articleMap = new HashMap<>(); + BeanUtil.copyProperties(map, articleMap); + articleMap.put("id", article.getId()); + cmsCoreService.articleProcess(articleMap, column.getArticleTemplate(), column.getPath()); } } } -- Gitblit v1.9.1