Commit 59b486e0 authored by a123456's avatar a123456

Merge branch '4.7.0' of https://gitee.com/mingSoft/MCMS.git into 4.7.0

# Conflicts:
#	src/main/webapp/WEB-INF/manager/mweixin/weixin.ftl
Signed-off-by: 's avatara123456 <1209165801@qq.com>
parents c3db17b3 1cdf5f8a
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -129,7 +129,7 @@ public class ArticleAction extends BaseAction { ...@@ -129,7 +129,7 @@ public class ArticleAction extends BaseAction {
List<ColumnEntity> list = columnBiz.queryAll(appId, this.getModelCodeId(request, ModelCode.CMS_COLUMN)); List<ColumnEntity> list = columnBiz.queryAll(appId, this.getModelCodeId(request, ModelCode.CMS_COLUMN));
request.setAttribute("listColumn", JSONArray.toJSONString(list)); request.setAttribute("listColumn", JSONArray.toJSONString(list));
// 返回路径 // 返回路径
return view("/cms/article/index"); // 这里表示显示/manager/cms/article/article_list.ftl return "/cms/article/index"; // 这里表示显示/manager/cms/article/article_list.ftl
} }
/** /**
...@@ -152,7 +152,7 @@ public class ArticleAction extends BaseAction { ...@@ -152,7 +152,7 @@ public class ArticleAction extends BaseAction {
mode.addAttribute("articleType", articleType); mode.addAttribute("articleType", articleType);
mode.addAttribute("categoryId", categoryId); mode.addAttribute("categoryId", categoryId);
//返回文章页面显示地址 //返回文章页面显示地址
return view("/cms/article/article_main"); return "/cms/article/article_main";
} }
/** /**
...@@ -230,7 +230,7 @@ public class ArticleAction extends BaseAction { ...@@ -230,7 +230,7 @@ public class ArticleAction extends BaseAction {
ArticleEntity article = new ArticleEntity(); ArticleEntity article = new ArticleEntity();
mode.addAttribute("article", article); mode.addAttribute("article", article);
// 返回路径 // 返回路径
return view("/cms/article/article_form"); // 这里表示显示/manager/cms/article/article_save.ftl return "/cms/article/article_form"; // 这里表示显示/manager/cms/article/article_save.ftl
} }
/** /**
...@@ -298,7 +298,7 @@ public class ArticleAction extends BaseAction { ...@@ -298,7 +298,7 @@ public class ArticleAction extends BaseAction {
.getEntity(column.getColumnContentModelId()); .getEntity(column.getColumnContentModelId());
if (contentModel != null) { if (contentModel != null) {
// 保存新增字段的信息 // 保存新增字段的信息
Map param = this.checkField(listField, request, article.getBasicId()); Map<String, Object> param = this.checkField(listField, request, article.getBasicId());
fieldBiz.insertBySQL(contentModel.getCmTableName(), param); fieldBiz.insertBySQL(contentModel.getCmTableName(), param);
} }
...@@ -416,7 +416,7 @@ public class ArticleAction extends BaseAction { ...@@ -416,7 +416,7 @@ public class ArticleAction extends BaseAction {
ContentModelEntity contentModel = (ContentModelEntity) contentBiz ContentModelEntity contentModel = (ContentModelEntity) contentBiz
.getEntity(oldColumn.getColumnContentModelId()); .getEntity(oldColumn.getColumnContentModelId());
// 删除旧的内容模型中保存的值 // 删除旧的内容模型中保存的值
Map wheres = new HashMap(); Map<String, Integer> wheres = new HashMap<String, Integer>();
wheres.put("basicId", article.getBasicId()); wheres.put("basicId", article.getBasicId());
if (contentModel != null) { if (contentModel != null) {
fieldBiz.deleteBySQL(contentModel.getCmTableName(), wheres); fieldBiz.deleteBySQL(contentModel.getCmTableName(), wheres);
...@@ -428,13 +428,17 @@ public class ArticleAction extends BaseAction { ...@@ -428,13 +428,17 @@ public class ArticleAction extends BaseAction {
ContentModelEntity newContentModel = (ContentModelEntity) contentBiz ContentModelEntity newContentModel = (ContentModelEntity) contentBiz
.getEntity(column.getColumnContentModelId()); .getEntity(column.getColumnContentModelId());
if (newContentModel != null) { if (newContentModel != null) {
Map param = this.checkField(listField, request, article.getBasicId()); Map<String, Object> param = this.checkField(listField, request, article.getBasicId());
fieldBiz.insertBySQL(newContentModel.getCmTableName(), param); fieldBiz.insertBySQL(newContentModel.getCmTableName(), param);
} }
} }
} }
} }
//判断是否修改了所属栏目
if(oldArticle.getBasicCategoryId()!=article.getBasicCategoryId()){
//拼接栏目路径和文章编号及文件后缀
article.setArticleUrl(column.getColumnPath() + File.separator + article.getBasicId() + ParserUtil.HTML_SUFFIX);
}
// 添加文章所属的站点id // 添加文章所属的站点id
article.setArticleWebId(appId); article.setArticleWebId(appId);
// 设置文章所属的栏目实体 // 设置文章所属的栏目实体
...@@ -450,11 +454,11 @@ public class ArticleAction extends BaseAction { ...@@ -450,11 +454,11 @@ public class ArticleAction extends BaseAction {
// 保存所有的字段信息 // 保存所有的字段信息
List<BaseEntity> listField = fieldBiz.queryListByCmid(column.getColumnContentModelId()); List<BaseEntity> listField = fieldBiz.queryListByCmid(column.getColumnContentModelId());
// // update中的where条件 // // update中的where条件
Map where = new HashMap(); Map<String, Integer> where = new HashMap<String, Integer>();
// 压入默认的basicId字段 // 压入默认的basicId字段
where.put("basicId", article.getBasicId()); where.put("basicId", article.getBasicId());
// 遍历字段的信息 // 遍历字段的信息
Map param = this.checkField(listField, request, article.getBasicId()); Map<String, Object> param = this.checkField(listField, request, article.getBasicId());
ContentModelEntity contentModel = (ContentModelEntity) contentBiz ContentModelEntity contentModel = (ContentModelEntity) contentBiz
.getEntity(column.getColumnContentModelId()); .getEntity(column.getColumnContentModelId());
if (contentModel != null) { if (contentModel != null) {
...@@ -513,7 +517,7 @@ public class ArticleAction extends BaseAction { ...@@ -513,7 +517,7 @@ public class ArticleAction extends BaseAction {
model.addAttribute("categoryId", categoryId);// 编辑封面 model.addAttribute("categoryId", categoryId);// 编辑封面
model.addAttribute("isEditCategory", true);// 编辑封面 model.addAttribute("isEditCategory", true);// 编辑封面
model.addAttribute("columnType", columnType); model.addAttribute("columnType", columnType);
return view("/cms/article/article_form"); return "/cms/article/article_form";
} else if (id > 0) { // 文章id获取 } else if (id > 0) { // 文章id获取
// 允许编辑文章时更改分类 // 允许编辑文章时更改分类
List<ColumnEntity> list = columnBiz.queryAll(appId, this.getModelCodeId(request, ModelCode.CMS_COLUMN)); List<ColumnEntity> list = columnBiz.queryAll(appId, this.getModelCodeId(request, ModelCode.CMS_COLUMN));
...@@ -528,7 +532,7 @@ public class ArticleAction extends BaseAction { ...@@ -528,7 +532,7 @@ public class ArticleAction extends BaseAction {
// 判断是否是封面类型的栏目,如果是封面类型的栏目有些信息需要屏蔽,例如分类 // 判断是否是封面类型的栏目,如果是封面类型的栏目有些信息需要屏蔽,例如分类
ColumnEntity column = articleEntity.getColumn(); ColumnEntity column = articleEntity.getColumn();
int columnType = column.getColumnType(); int columnType = column.getColumnType();
if (column.getColumnType() == ColumnEntity.COLUMN_TYPE_COVER) { if (column.getColumnType() == ColumnEntity.ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()) {
model.addAttribute("categoryTitle", categoryTitle); model.addAttribute("categoryTitle", categoryTitle);
model.addAttribute("categoryId", column.getCategoryId());// 编辑封面 model.addAttribute("categoryId", column.getCategoryId());// 编辑封面
model.addAttribute("isEditCategory", true);// 编辑封面 model.addAttribute("isEditCategory", true);// 编辑封面
...@@ -538,9 +542,9 @@ public class ArticleAction extends BaseAction { ...@@ -538,9 +542,9 @@ public class ArticleAction extends BaseAction {
} }
model.addAttribute("columnType", columnType); model.addAttribute("columnType", columnType);
model.addAttribute("categoryId", column.getCategoryId());// 编辑封面 model.addAttribute("categoryId", column.getCategoryId());// 编辑封面
return view("/cms/article/article_form"); return "/cms/article/article_form";
} else {// 非法 } else {// 非法
// return view("/cms/article/article_form"); // return "/cms/article/article_form");
return this.redirectBack(request, true); return this.redirectBack(request, true);
} }
} }
...@@ -583,7 +587,7 @@ public class ArticleAction extends BaseAction { ...@@ -583,7 +587,7 @@ public class ArticleAction extends BaseAction {
* @return 字段信息 * @return 字段信息
*/ */
private Map checkField(List<BaseEntity> listField, HttpServletRequest request, int articleId) { private Map checkField(List<BaseEntity> listField, HttpServletRequest request, int articleId) {
Map mapParams = new HashMap(); Map<String, Object> mapParams = new HashMap();
// 压入默认的basicId字段 // 压入默认的basicId字段
mapParams.put("basicId", articleId); mapParams.put("basicId", articleId);
// 遍历字段名 // 遍历字段名
......
...@@ -10,12 +10,6 @@ import java.util.Map; ...@@ -10,12 +10,6 @@ import java.util.Map;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.constant.e.ColumnTypeEnum;
import net.mingsoft.mdiy.biz.IContentModelBiz;
import net.mingsoft.mdiy.entity.ContentModelEntity;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.PageUtil; import cn.hutool.core.util.PageUtil;
...@@ -26,8 +20,13 @@ import freemarker.template.Template; ...@@ -26,8 +20,13 @@ import freemarker.template.Template;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import freemarker.template.TemplateNotFoundException; import freemarker.template.TemplateNotFoundException;
import net.mingsoft.base.constant.Const; import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.SpringUtil; import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.constant.e.ColumnTypeEnum;
import net.mingsoft.mdiy.biz.IContentModelBiz;
import net.mingsoft.mdiy.entity.ContentModelEntity;
import net.mingsoft.mdiy.parser.TagParser; import net.mingsoft.mdiy.parser.TagParser;
import net.mingsoft.mdiy.util.ParserUtil; import net.mingsoft.mdiy.util.ParserUtil;
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title></title> <title></title>
<!-- <#include "/include/head-file.ftl"/> --> <!-- <#include "/include/head-file.ftl"/> -->
<!--#include virtual="../../include/head-file.ftl" --> <!--#include virtual="../include/head-file.ftl" -->
</head> </head>
<body> <body>
<!--#include virtual="menu.ftl" --> <!--#include virtual="menu.ftl" -->
<!--#include virtual="material/index.ftl" --> <!--#include virtual="material/index.ftl" -->
<!--#include virtual="article/index.ftl" -->
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment