Merge branch 'master' into adaptive-oracle-mysql

master
xierz 5 years ago
commit 3b8fb103c1
  1. 25
      doc/5.2-patch.sql
  2. 2
      pom.xml
  3. 11
      src/main/java/net/mingsoft/cms/biz/ICacheBiz.java
  4. 26
      src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
  5. 35
      src/main/java/net/mingsoft/cms/biz/impl/EhcacheBizImpl.java
  6. 1
      src/main/java/net/mingsoft/cms/dao/ICategoryDao.java
  7. 14
      src/main/java/net/mingsoft/cms/dao/IContentDao.xml
  8. 1
      src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
  9. 2
      src/main/resources/application.yml
  10. 17
      src/main/webapp/WEB-INF/manager/cms/content/main.ftl

@ -203,3 +203,28 @@ ALTER TABLE `log`
MODIFY COLUMN `log_error_msg` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '错误消息' AFTER `id`,
MODIFY COLUMN `log_result` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '返回参数' AFTER `log_error_msg`,
MODIFY COLUMN `log_param` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '请求参数' AFTER `log_result`;
alter table log rename to logger;
ALTER TABLE `role`
ADD COLUMN `create_by` int(10) NULL COMMENT '创建人',
ADD COLUMN `create_date` datetime(0) NULL COMMENT '创建时间',
ADD COLUMN `update_by` int(10) NULL COMMENT '更新人',
ADD COLUMN `update_date` datetime(0) NULL COMMENT '更新时间',
ADD COLUMN `del` int(1) NULL COMMENT '删除标识';
ALTER TABLE `model`
ADD COLUMN `create_by` int(10) NULL COMMENT '创建人',
ADD COLUMN `create_date` datetime(0) NULL COMMENT '创建时间',
ADD COLUMN `update_by` int(10) NULL COMMENT '更新人',
ADD COLUMN `update_date` datetime(0) NULL COMMENT '更新时间',
ADD COLUMN `del` int(1) NULL COMMENT '删除标识';
ALTER TABLE `people`
ADD COLUMN `create_by` int(10) NULL COMMENT '创建人',
ADD COLUMN `create_date` datetime(0) NULL COMMENT '创建时间',
ADD COLUMN `update_by` int(10) NULL COMMENT '更新人',
ADD COLUMN `update_date` datetime(0) NULL COMMENT '更新时间',
ADD COLUMN `del` int(1) NULL COMMENT '删除标识';

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.mingsoft</groupId>
<artifactId>ms-mcms</artifactId>
<version>5.2.0-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<name>ms-mcms</name>
<!-- 打包jar包 -->
<packaging>jar</packaging>

@ -1,11 +0,0 @@
package net.mingsoft.cms.biz;
public interface ICacheBiz {
void set(String cacheName, String key, Object value);
<T> T get(String cacheName, String key, Class<T> cls);
void del(String cacheName, String key);
}

@ -22,37 +22,23 @@
package net.mingsoft.cms.biz.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import net.mingsoft.basic.constant.Const;
import net.mingsoft.basic.holder.DataHolder;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.base.biz.impl.BaseBizImpl;
import net.mingsoft.base.dao.IBaseDao;
import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.constant.e.CategoryTypeEnum;
import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.dao.ICategoryDao;
import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.dao.IContentDao;
import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.util.CmsParserUtil;
import net.mingsoft.mdiy.bean.PageBean;
import net.mingsoft.mdiy.entity.ModelEntity;
import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import net.mingsoft.base.biz.impl.BaseBizImpl;
import net.mingsoft.base.dao.IBaseDao;
import java.io.IOException;
import java.util.*;
import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.dao.IContentDao;
import java.util.List;
import java.util.Map;
/**
* 文章管理持久化层

@ -1,35 +0,0 @@
package net.mingsoft.cms.biz.impl;
import com.alibaba.fastjson.JSONObject;
import net.mingsoft.cms.biz.ICacheBiz;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Service;
@Service("abc")
public class EhcacheBizImpl implements ICacheBiz {
@Autowired
private CacheManager cacheManager;
@Override
public void set(String cacheName, String key, Object value) {
this.cacheManager.getCache(cacheName).put(key, JSONObject.toJSONString(value));
}
@Override
public <T> T get(String cacheName, String key, Class<T> cls) {
String str = this.cacheManager.getCache(cacheName).get(key, String.class);
if (StringUtils.isBlank(str)) {
return null;
}
return JSONObject.parseObject(str, cls);
}
@Override
public void del(String cacheName, String key) {
this.cacheManager.getCache(cacheName).evictIfPresent(key);
}
}

@ -20,7 +20,6 @@
*/
package net.mingsoft.cms.dao;
import com.baomidou.mybatisplus.annotation.SqlParser;
import net.mingsoft.base.dao.IBaseDao;
import net.mingsoft.cms.entity.CategoryEntity;
import org.springframework.stereotype.Component;

@ -307,13 +307,13 @@
and FIND_IN_SET(a.category_id,#{ids})>0
</if>
<if test="map.content_title!=null">
and a.content_title like CONCAT(CONCAT("%",#{map.content_title}),"%")
and a.content_title like CONCAT(CONCAT('%',#{map.content_title}),'%')
</if>
<if test="map.content_author!=null">
and a.content_author like CONCAT(CONCAT("%",#{map.content_author}),"%")
and a.content_author like CONCAT(CONCAT('%',#{map.content_author}),'%')
</if>
<if test="map.content_source!=null">
and a.content_source like CONCAT(CONCAT("%",#{map.content_source}),"%")
and a.content_source like CONCAT(CONCAT('%',#{map.content_source}),'%')
</if>
<if test="map.content_type!=null">
and <foreach item="item" index="index" collection="map.content_type.split(',')" open="(" separator="or" close=")">
@ -321,13 +321,13 @@
</foreach>
</if>
<if test="map.content_description!=null">
and a.content_description like CONCAT(CONCAT("%",#{map.content_description}),"%")
and a.content_description like CONCAT(CONCAT('%',#{map.content_description}),'%')
</if>
<if test="map.content_keyword!=null">
and a.content_keyword like CONCAT(CONCAT("%",#{map.content_keyword}),"%")
and a.content_keyword like CONCAT(CONCAT('%',#{map.content_keyword}),'%')
</if>
<if test="map.content_details!=null">
and a.content_details like CONCAT(CONCAT("%",#{map.content_details}),"%")
and a.content_details like CONCAT(CONCAT('%',#{map.content_details}),'%')
</if>
<if test="map.content_datetime_start!=null and map.content_datetime_end!=null">
<if test="_databaseId == 'mysql'">
@ -341,7 +341,7 @@
<if test="tableName!=null and tableName!='' and diyMap!=null">
<foreach item="item" index="index" collection="diyList" open=""
separator="" close="">
and d.${field.key} like CONCAT(CONCAT("%",#{item.value}),"%")
and d.${field.key} like CONCAT(CONCAT('%',#{item.value}),'%')
</foreach>
</if>
</where>

@ -27,7 +27,6 @@ import freemarker.core.ParseException;
import freemarker.template.MalformedTemplateNameException;
import freemarker.template.TemplateNotFoundException;
import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.holder.DataHolder;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.cms.bean.CategoryBean;

@ -96,6 +96,6 @@ mybatis-plus:
db-config:
id-type: auto
configuration:
database-id: oracle
database-id: mysql
cache-enabled: true
jdbc-type-for-null: 'null' #注意:单引号

@ -11,7 +11,7 @@
<el-header class="ms-header" height="50px">
<el-col :span="12">
<@shiro.hasPermission name="cms:content:save">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="save(0)">新增</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="save()">新增</el-button>
</@shiro.hasPermission>
<@shiro.hasPermission name="cms:content:del">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="del(selectionList)" :disabled="!selectionList.length">删除</el-button>
@ -368,13 +368,18 @@
},
//新增
save: function (id) {
//id有值时编辑
if (id) {
location.href = this.manager + "/cms/content/form.do?id=" + id;
} else if (id == 0){
//在全部栏目下新增文章
location.href = this.manager + "/cms/content/form.do";
} else {
location.href = this.manager + "/cms/content/form.do?categoryId=" + this.form.categoryId;
}else {
//根据当前栏目新增时自动选中栏目
var categoryId = this.form.categoryId;
if (categoryId) {
location.href = this.manager + "/cms/content/form.do?categoryId=" + this.form.categoryId;
}else {
//如果栏目id没有值就单纯的新增,不自动选定栏目
location.href = this.manager + "/cms/content/form.do";
}
}
},
//表格数据转换

Loading…
Cancel
Save