From 12f5881619d651615272f83be9616db826c3f6e1 Mon Sep 17 00:00:00 2001 From: wujj <1027418825@qq.com> Date: Fri, 6 Nov 2020 11:43:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/mingsoft/cms/action/GeneraterAction.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/mingsoft/cms/action/GeneraterAction.java b/src/main/java/net/mingsoft/cms/action/GeneraterAction.java index 19173026..866ca49a 100644 --- a/src/main/java/net/mingsoft/cms/action/GeneraterAction.java +++ b/src/main/java/net/mingsoft/cms/action/GeneraterAction.java @@ -147,20 +147,20 @@ public class GeneraterAction extends BaseAction { * * @param request * @param response - * @param CategoryId + * @param categoryId */ - @RequestMapping("/{CategoryId}/genernateColumn") + @RequestMapping("/{categoryId}/genernateColumn") @LogAnn(title = "生成栏目", businessType = BusinessTypeEnum.UPDATE) @RequiresPermissions("cms:generate:column") @ResponseBody - public ResultData genernateColumn(HttpServletRequest request, HttpServletResponse response, @PathVariable int CategoryId) throws IOException { + public ResultData genernateColumn(HttpServletRequest request, HttpServletResponse response, @PathVariable String categoryId) throws IOException { // 获取站点id AppEntity app = BasicUtil.getApp(); List columns = new ArrayList(); // 如果栏目id小于0则更新所有的栏目,否则只更新选中的栏目 - if (CategoryId>0) { + if (!"0".equals(categoryId)) { CategoryEntity categoryEntity = new CategoryEntity(); - categoryEntity.setId(CategoryId+""); + categoryEntity.setId(categoryId); columns = categoryBiz.queryChilds(categoryEntity); } else { // 获取所有的内容管理栏目 @@ -243,7 +243,8 @@ public class GeneraterAction extends BaseAction { map.put(ParserUtil.HTML, ParserUtil.HTML); map.put(ParserUtil.URL, BasicUtil.getUrl()); map.put(ParserUtil.PAGE, page); - if(StringUtils.isNotEmpty(columnId)){ + // 生成所有栏目的文章 + if("0".equals(columnId)){ CategoryEntity categoryEntity = new CategoryEntity(); categoryList = categoryBiz.query(categoryEntity); for(CategoryEntity category : categoryList){ @@ -262,6 +263,7 @@ public class GeneraterAction extends BaseAction { contentBean.setOrder(attributeBean.getOrder()); contentBean.setOrderBy(attributeBean.getOrderby()); } + //将文章列表标签中的中的参数 articleIdList = contentBiz.queryIdsByCategoryIdForParser(contentBean); // 有符合条件的就更新 if (articleIdList.size() > 0) { @@ -269,7 +271,7 @@ public class GeneraterAction extends BaseAction { } } }else { - CategoryEntity category = (CategoryEntity) categoryBiz.getEntity(Integer.parseInt(columnId)); + CategoryEntity category = (CategoryEntity) categoryBiz.getById(columnId); contentBean.setContentCategoryId(columnId); // 分类是列表 if(category.getCategoryType().equals("1")){