Commit 096d6f2b authored by guwd's avatar guwd

1、优化列表、封面枚举类型,原来是 1,2表示

2、优化搜索接口
parent 871245ee
......@@ -39,29 +39,6 @@
<artifactId>ms-mpeople</artifactId>
</dependency>
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>ms-ad</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>net.mingsoft</groupId>-->
<!-- <artifactId>ms-clean</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>net.mingsoft</groupId>-->
<!-- <artifactId>ms-quartz</artifactId>-->
<!-- </dependency>-->
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>store-client</artifactId>
<version>5.2-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
......
......@@ -163,7 +163,7 @@ public class CategoryAction extends BaseAction {
if(!StringUtil.checkLength(category.getCategoryPath()+"", 1, 100)){
return ResultData.build().error(getResString("err.length", this.getResString("category.path"), "1", "100"));
}
if(!StringUtil.checkLength(category.getCategoryParentId()+"", 1, 100)){
if(!StringUtil.checkLength(category.getCategoryParentIds()+"", 1, 100)){
return ResultData.build().error(getResString("err.length", this.getResString("category.parent.id"), "1", "100"));
}
//判断拼音是否重复
......@@ -241,7 +241,7 @@ public class CategoryAction extends BaseAction {
if(!StringUtil.checkLength(category.getCategoryPath()+"", 0, 100)){
return ResultData.build().error(getResString("err.length", this.getResString("category.path"), "1", "100"));
}
if(!StringUtil.checkLength(category.getCategoryParentId()+"", 0, 100)){
if(!StringUtil.checkLength(category.getCategoryParentIds()+"", 0, 100)){
return ResultData.build().error(getResString("err.length", this.getResString("category.parent.id"), "1", "100"));
}
//判断拼音是否重复并且是否和原拼音相同
......@@ -268,7 +268,7 @@ public class CategoryAction extends BaseAction {
}
//判断是否选择子级为所属栏目
CategoryEntity _category = new CategoryEntity();
_category.setCategoryParentId(category.getId());
_category.setCategoryParentIds(category.getId());
List<CategoryEntity> categoryList = categoryBiz.queryChilds(_category);
for(CategoryEntity item:categoryList){
if(item.getId().equals(category.getCategoryId())){
......@@ -302,7 +302,7 @@ public class CategoryAction extends BaseAction {
return ResultData.build().error(getResString("err.error", this.getResString("id")));
}
category = categoryBiz.getById(category.getId());
category.setCategoryParentId(null);
category.setCategoryParentIds(null);
List<CategoryEntity> childs = categoryBiz.queryChilds(category);
//更新与父节点相同类型的子栏目的模板内容
for (int i =0; i < childs.size(); i++) {
......
......@@ -36,6 +36,7 @@ import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.constant.e.CategoryTypeEnum;
import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.util.CmsParserUtil;
import net.mingsoft.mdiy.bean.PageBean;
......@@ -178,9 +179,9 @@ public class GeneraterAction extends BaseAction {
articleIdList = contentBiz.queryIdsByCategoryIdForParser(contentBean);
// 判断列表类型
switch (column.getCategoryType()) {
switch (CategoryTypeEnum.get(column.getCategoryType())) {
//TODO 暂时先用字符串代替
case "1": // 列表
case LIST: // 列表
// 判断模板文件是否存在
if (!FileUtil.exist(ParserUtil.buildTempletPath(column.getCategoryListUrl()))) {
......@@ -190,7 +191,7 @@ public class GeneraterAction extends BaseAction {
CmsParserUtil.generateList(column, articleIdList.size(),htmlDir);
break;
case "2":// 单页
case COVER:// 单页
if (articleIdList.size() == 0) {
CategoryBean columnArticleIdBean = new CategoryBean();
CopyOptions copyOptions = CopyOptions.create();
......@@ -235,7 +236,7 @@ public class GeneraterAction extends BaseAction {
// 生成所有栏目的文章
if ("0".equals(columnId)) {
categoryList = categoryBiz.list(Wrappers.<CategoryEntity>lambdaQuery()
.isNull(CategoryEntity::getCategoryParentId));
.isNull(CategoryEntity::getCategoryParentIds));
} else {
CategoryEntity category = (CategoryEntity) categoryBiz.getById(columnId);
categoryList.add(category);
......@@ -246,13 +247,13 @@ public class GeneraterAction extends BaseAction {
//将文章列表标签中的中的参数
articleIdList = contentBiz.queryIdsByCategoryIdForParser(contentBean);
// 分类是列表
if (category.getCategoryType().equals("1")) {
if (category.getCategoryType().equals(CategoryTypeEnum.LIST.toString())) {
// 判断模板文件是否存在
if (!FileUtil.exist(ParserUtil.buildTempletPath(category.getCategoryListUrl())) || StringUtils.isEmpty(category.getCategoryListUrl())) {
LOG.error("模板不存在:{}", category.getCategoryUrl());
continue;
}
} else if (category.getCategoryType().equals("2")) {
} else if (category.getCategoryType().equals(CategoryTypeEnum.COVER.toString())) {
CategoryBean columnArticleIdBean = new CategoryBean();
CopyOptions copyOptions = CopyOptions.create();
copyOptions.setIgnoreError(true);
......
......@@ -21,8 +21,12 @@
package net.mingsoft.cms.action.web;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Editor;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.PageUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import freemarker.core.ParseException;
import freemarker.template.MalformedTemplateNameException;
import freemarker.template.TemplateException;
......@@ -36,6 +40,7 @@ import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.constant.e.CategoryTypeEnum;
import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.util.CmsParserUtil;
......@@ -45,6 +50,7 @@ import net.mingsoft.mdiy.biz.IPageBiz;
import net.mingsoft.mdiy.entity.ModelEntity;
import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
......@@ -126,7 +132,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
String content = "";
try {
//根据模板路径,参数生成
content = CmsParserUtil.generate(ParserUtil.INDEX + ParserUtil.HTM_SUFFIX, map,htmlDir);
content = CmsParserUtil.generate(ParserUtil.INDEX + ParserUtil.HTM_SUFFIX, map, htmlDir);
} catch (TemplateNotFoundException e) {
e.printStackTrace();
} catch (MalformedTemplateNameException e) {
......@@ -184,7 +190,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
String content = "";
try {
//根据模板路径,参数生成
content = CmsParserUtil.generate(columnArticles.get(0).getCategoryListUrl(),map,htmlDir);
content = CmsParserUtil.generate(columnArticles.get(0).getCategoryListUrl(), map, htmlDir);
} catch (TemplateNotFoundException e) {
e.printStackTrace();
} catch (MalformedTemplateNameException e) {
......@@ -252,8 +258,8 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
// 文章的栏目路径
String categoryParentId = articleIdList.get(artId).getId();
if (StringUtils.isNotBlank(articleIdList.get(artId).getCategoryParentId())) {
categoryParentId += ',' + articleIdList.get(artId).getCategoryParentId();
if (StringUtils.isNotBlank(articleIdList.get(artId).getCategoryParentIds())) {
categoryParentId += ',' + articleIdList.get(artId).getCategoryParentIds();
}
// 文章的栏目模型编号
Integer columnContentModelId = articleIdList.get(artId).getMdiyModelId();
......@@ -286,7 +292,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
try {
//根据模板路径,参数生成
content = CmsParserUtil.generate(column.getCategoryUrl(), map,htmlDir);
content = CmsParserUtil.generate(column.getCategoryUrl(), map, htmlDir);
} catch (TemplateNotFoundException e) {
e.printStackTrace();
} catch (MalformedTemplateNameException e) {
......@@ -311,7 +317,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
public String search(HttpServletRequest request, HttpServletResponse response) {
//设置分页类
PageBean page = new PageBean();
page.setSize(ParserUtil.getPageSize(SEARCH + ParserUtil.HTM_SUFFIX,20));
page.setSize(ParserUtil.getPageSize(SEARCH + ParserUtil.HTM_SUFFIX, 20));
//参数集合,提供给解析使用
Map<String, Object> params = new HashMap<>();
......@@ -336,15 +342,33 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
//获取栏目信息
int typeId = 0;
String categoryIds = BasicUtil.getString("categoryIds");
List categoryIdList = CollectionUtil.newArrayList();
//当传递了栏目编号,但不是栏目集合
if (StringUtils.isNotBlank(categoryIds) && !categoryIds.contains(",")) {
typeId = Integer.parseInt(categoryIds);
} else {
//取出所有的子栏目
String[] ids = categoryIds.split(",");
List<CategoryEntity> categoryList = categoryBiz.list(Wrappers.<CategoryEntity>lambdaQuery().ne(CategoryEntity::getCategoryType, CategoryTypeEnum.LINK.toString()));
categoryIdList = CollectionUtil.newArrayList(ids);
for(CategoryEntity c:categoryList) {
if(StringUtils.isNotEmpty(c.getParentids())) {
for(String id:ids) {
if(c.getParentids().indexOf(id)>-1) {
categoryIdList.add(c.getId());
break;
}
}
}
}
}
//重新组织 ID
categoryIds = StringUtils.join(categoryIdList, ",");
//当前访问的项目地址
String url = BasicUtil.getUrl();
//根据栏目确定自定义模型
if (typeId > 0) {
column = (CategoryEntity) categoryBiz.getEntity(typeId);
......@@ -413,6 +437,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
Map<String, Object> searchMap = field;
searchMap.put("categoryIds",categoryIds);
StringBuilder urlParams = new StringBuilder();
searchMap.forEach((k, v) -> {
......@@ -488,7 +513,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
String content = "";
try {
//根据模板路径,参数生成
content = CmsParserUtil.generate(SEARCH + ParserUtil.HTM_SUFFIX, params,htmlDir);
content = CmsParserUtil.generate(SEARCH + ParserUtil.HTM_SUFFIX, params, htmlDir);
} catch (TemplateNotFoundException e) {
e.printStackTrace();
} catch (MalformedTemplateNameException e) {
......@@ -549,8 +574,8 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
public static void main(String[] args) {
int [] a= PageUtil.rainbow(20,30,5);
for(int _a:a) {
int[] a = PageUtil.rainbow(20, 30, 5);
for (int _a : a) {
System.out.println(_a);
}
......
......@@ -117,13 +117,13 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
if(StringUtils.isNotEmpty(categoryEntity.getCategoryId())&&Long.parseLong(categoryEntity.getCategoryId())>0) {
CategoryEntity category = (CategoryEntity)getById(categoryEntity.getCategoryId());
path = category.getCategoryPath();
if(StringUtils.isEmpty(category.getCategoryParentId())) {
categoryEntity.setCategoryParentId(category.getId());
if(StringUtils.isEmpty(category.getCategoryParentIds())) {
categoryEntity.setCategoryParentIds(category.getId());
} else {
categoryEntity.setCategoryParentId(category.getCategoryParentId()+","+category.getId());
categoryEntity.setCategoryParentIds(category.getCategoryParentIds()+","+category.getId());
}
}else {
categoryEntity.setCategoryParentId(null);
categoryEntity.setCategoryParentIds(null);
}
//保存时先保存再修改链接地址,修改时直接修改
if(StringUtils.isNotBlank(categoryEntity.getId())) {
......@@ -136,10 +136,10 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
category.setCategoryId(categoryEntity.getId());
List<CategoryEntity> list = categoryDao.query(category);
list.forEach(x->{
if(StringUtils.isEmpty(categoryEntity.getCategoryParentId())) {
x.setCategoryParentId(categoryEntity.getId());
if(StringUtils.isEmpty(categoryEntity.getCategoryParentIds())) {
x.setCategoryParentIds(categoryEntity.getId());
} else {
x.setCategoryParentId(categoryEntity.getCategoryParentId()+","+categoryEntity.getId());
x.setCategoryParentIds(categoryEntity.getCategoryParentIds()+","+categoryEntity.getId());
}
String path=categoryEntity.getCategoryPath();
//判断是否有parentIds
......@@ -181,7 +181,7 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
CategoryEntity category = (CategoryEntity) categoryDao.selectById(categoryId);
//删除父类
if(category != null){
category.setCategoryParentId(null);
category.setCategoryParentIds(null);
List<CategoryEntity> childrenList = categoryDao.queryChildren(category);
List<String> ids = new ArrayList<>();
for(int i = 0; i < childrenList.size(); i++){
......@@ -233,7 +233,7 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
* @param entity
*/
private void setTopId(CategoryEntity entity){
String categoryParentId = entity.getCategoryParentId();
String categoryParentId = entity.getCategoryParentIds();
if(StrUtil.isNotBlank(categoryParentId)){
String[] ids = categoryParentId.split(",");
//如果有ParentId就取第一个
......
......@@ -30,6 +30,7 @@ import net.mingsoft.basic.holder.DataHolder;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.constant.e.CategoryTypeEnum;
import net.mingsoft.cms.dao.ICategoryDao;
import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity;
......@@ -141,7 +142,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
for(CategoryEntity category : categoryList){
contentBean.setCategoryId(category.getId());
// 分类是列表
if(category.getCategoryType().equals("1")){
if(category.getCategoryType().equals(CategoryTypeEnum.LIST.toString())){
// 判断模板文件是否存在
if (!FileUtil.exist(ParserUtil.buildTempletPath(category.getCategoryListUrl())) || StringUtils.isEmpty(category.getCategoryListUrl())) {
LOG.error("模板不存在:{}",category.getCategoryUrl());
......@@ -172,7 +173,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
ContentBean contentBean = new ContentBean();
contentBean.setCategoryId(column.getId());
// 分类是列表
if(column.getCategoryType().equals("1")) {
if(column.getCategoryType().equals(CategoryTypeEnum.LIST.toString())) {
// 判断模板文件是否存在
if (!FileUtil.exist(ParserUtil.buildTempletPath(column.getCategoryListUrl()))) {
LOG.error("模板不存在:{}", column.getCategoryUrl());
......@@ -191,12 +192,12 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
}
articleIdList = contentDao.queryIdsByCategoryIdForParser(contentBean);
// 判断列表类型
switch (column.getCategoryType()) {
switch (CategoryTypeEnum.get(column.getCategoryType())) {
//TODO 暂时先用字符串代替
case "1": // 列表
case LIST: // 列表
CmsParserUtil.generateList(column, articleIdList.size(),htmlDir);
break;
case "2":// 单页
case COVER:// 单页
if(articleIdList.size()==0){
CategoryBean columnArticleIdBean=new CategoryBean();
CopyOptions copyOptions=CopyOptions.create();
......
/**
* The MIT License (MIT) * Copyright (c) 2020 铭软科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package net.mingsoft.cms.constant.e;
import net.mingsoft.base.constant.e.BaseEnum;
/**
* @Author: 铭飞团队
* @Description:
* @Date: Create in 2020/06/23 14:18
*/
public enum CategoryTypeEnum implements BaseEnum {
/**
* 列表
*/
LIST("1"),
/**
* 封面
*/
COVER("2"),
/**
* 链接
*/
LINK("3");
CategoryTypeEnum(String type) {
this.type = type;
}
private String type;
public static CategoryTypeEnum get(String type) {
for (CategoryTypeEnum e : CategoryTypeEnum.values()) {
if (e.type.equals(type)) {
return e;
}
}
return null;
}
@Override
public int toInt() {
return Integer.parseInt(type);
}
@Override
public String toString() {
return type;
}
}
......@@ -20,7 +20,7 @@
<result column="dict_id" property="dictId" /><!--字典对应编号 -->
<result column="category_flag" property="categoryFlag" /><!--栏目属性 -->
<result column="category_path" property="categoryPath" /><!--栏目路径 -->
<result column="category_parent_id" property="categoryParentId" /><!--父类型编号 -->
<result column="category_parent_ids" property="categoryParentIds" /><!--父类型编号 -->
<result column="create_by" property="createBy" /><!--创建人 -->
<result column="create_date" property="createDate" /><!--创建时间 -->
<result column="update_by" property="updateBy" /><!--修改人 -->
......@@ -49,7 +49,7 @@
<if test="dictId != null">dict_id,</if>
<if test="categoryFlag != null">category_flag,</if>
<if test="categoryPath != null and categoryPath != ''">category_path,</if>
<if test="categoryParentId != null and categoryParentId != ''">category_parent_id,</if>
<if test="categoryParentIds != null and categoryParentIds != ''">category_parent_ids,</if>
<if test="createBy &gt; 0">create_by,</if>
<if test="createDate != null">create_date,</if>
<if test="updateBy &gt; 0">update_by,</if>
......@@ -89,7 +89,7 @@
<if test="categoryTitle != null and categoryTitle != ''">category_title=#{categoryTitle},</if>
<if test="categoryPinyin != null and categoryPinyin != ''">category_pinyin=#{categoryPinyin},</if>
category_id=#{categoryId},
category_parent_id=#{categoryParentId},
category_parent_ids=#{categoryParentIds},
<if test="categoryType != null and categoryType != ''">category_type=#{categoryType},</if>
<if test="categorySort != null">category_sort=#{categorySort},</if>
<if test="categoryListUrl != null and categoryListUrl != ''">category_list_url=#{categoryListUrl},</if>
......@@ -137,7 +137,7 @@
<if test="dictId != null"> and dict_id=#{dictId} </if>
<if test="categoryFlag != null and categoryFlag != ''">and category_flag=#{categoryFlag}</if>
<if test="categoryPath != null and categoryPath != ''">and category_path=#{categoryPath}</if>
<if test="categoryParentId != null and categoryParentId != ''">and category_parent_id=#{categoryParentId}</if>
<if test="categoryParentIds != null and categoryParentIds != ''">and category_parent_ids=#{categoryParentIds}</if>
<if test="createBy &gt; 0"> and create_by=#{createBy} </if>
<if test="createDate != null"> and create_date=#{createDate} </if>
<if test="updateBy &gt; 0"> and update_by=#{updateBy} </if>
......@@ -157,11 +157,11 @@
</if>
and
(
<if test="categoryParentId != null and categoryParentId!=''">
find_in_set(#{categoryParentId},CATEGORY_PARENT_ID)
<if test="categoryParentIds != null and categoryParentIds!=''">
find_in_set(#{categoryParentIds},CATEGORY_PARENT_IDS)
</if>
<if test="categoryParentId == null or categoryParentId ==''">
find_in_set('${id}',CATEGORY_PARENT_ID)
<if test="categoryParentIds == null or categoryParentIds ==''">
find_in_set('${id}',CATEGORY_PARENT_IDS)
</if>
<if test="id != null">
or id=#{id}
......@@ -209,7 +209,7 @@
<if test="dictId != null"> and dict_id=#{dictId} </if>
<if test="categoryFlag != null and categoryFlag != ''"> and category_flag=#{categoryFlag}</if>
<if test="categoryPath != null and categoryPath != ''"> and category_path=#{categoryPath}</if>
<if test="categoryParentId != null and categoryParentId != ''"> and find_in_set(#{categoryParentId},category_parent_id)</if>
<if test="categoryParentIds != null and categoryParentIds != ''"> and find_in_set(#{categoryParentIds},category_parent_ids)</if>
<if test="createBy &gt; 0"> and create_by=#{createBy} </if>
<if test="createDate != null"> and create_date=#{createDate} </if>
<if test="updateBy &gt; 0"> and update_by=#{updateBy} </if>
......
......@@ -67,7 +67,7 @@
<result column="dict_id" property="dictId" /><!--字典对应编号 -->
<result column="category_flag" property="categoryFlag" /><!--栏目属性 -->
<result column="category_path" property="categoryPath" /><!--栏目路径 -->
<result column="category_parent_id" property="categoryParentId" /><!--父类型编号 -->
<result column="category_parent_ids" property="categoryParentIds" /><!--父类型编号 -->
<result column="create_by" property="createBy" /><!--创建人 -->
<result column="create_date" property="createDate" /><!--创建时间 -->
<result column="update_by" property="updateBy" /><!--修改人 -->
......@@ -219,7 +219,7 @@
ct.del=0
<if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT('%',#{contentTitle},'%')</if>
<if test="categoryId != null and categoryId != ''"> and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_ID)))</if>
(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)))</if>
<if test="contentType != null and contentType != ''"> and content_type LIKE CONCAT('%',#{contentType},'%')</if>
<if test="contentDisplay != null and contentDisplay != ''"> and content_display=#{contentDisplay}</if>
<if test="contentAuthor != null and contentAuthor != ''"> and content_author=#{contentAuthor}</if>
......@@ -251,7 +251,7 @@
<!-- 查询子栏目数据 -->
<if test="categoryId &gt; 0">
and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_ID)))
(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)))
</if>
<if test="beginTime!=null and beginTime!=''">
and content_datetime &gt;= #{beginTime}
......
......@@ -30,7 +30,7 @@ public class Upgrade {
//将parentId第一行设为顶级节点
String topId = "0";
String parentId = x.getParentid();
String parentId = x.getParentids();
if (parentId != null) {
topId = parentId.split(",")[0];
}
......@@ -40,7 +40,7 @@ public class Upgrade {
boolean leaf = true;
//判断是否叶子,循环查找,如果有节点的父节点中包含该节点的id则判断为否跳出循环
for (int i = 0; i< list.size(); i++) {
String pId = list.get(i).getParentid();
String pId = list.get(i).getParentids();
if (pId == null) {
continue;
}
......
......@@ -12,6 +12,8 @@ logging:
name: mcms.log #会在项目的根目录下生成对应的mcms.log文件,也可以根据实际情况写绝对路径,例如:d:/mcms.log
path: log #会在项目的根目录下生成log目录,里面会生成对应的日期目录,日期目录下面生成日志压缩包备份文件,默认按每10M分割一个日志文件,例如:log/2020-01/app-2020-01-03-18.1.log.gz(表示2020年1月3号下午六点的第一个备份),也可以根据实际情况写绝对路径,例如:d:/log
ms:
diy:
html-dir: html
mstore:
http: http://store.i.mingsoft.net/
host: store.i.mingsoft.net
......
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