Merge branch 'master' into oracle

This commit is contained in:
xierz 2020-12-22 09:58:59 +08:00
commit 52d6f85f50
11 changed files with 61 additions and 93 deletions

View File

@ -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_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_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`; 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 '删除标识';

View File

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

View File

@ -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);
}

View File

@ -22,37 +22,23 @@
package net.mingsoft.cms.biz.impl; package net.mingsoft.cms.biz.impl;
import cn.hutool.core.bean.BeanUtil; import net.mingsoft.base.biz.impl.BaseBizImpl;
import cn.hutool.core.bean.copier.CopyOptions; import net.mingsoft.base.dao.IBaseDao;
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.cms.bean.CategoryBean; import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.bean.ContentBean; 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.dao.ICategoryDao;
import net.mingsoft.cms.entity.CategoryEntity; import net.mingsoft.cms.dao.IContentDao;
import net.mingsoft.cms.entity.ContentEntity; 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.entity.ModelEntity;
import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; 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.List;
import java.util.*; import java.util.Map;
import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.dao.IContentDao;
/** /**
* 文章管理持久化层 * 文章管理持久化层

View File

@ -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);
}
}

View File

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

View File

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

View File

@ -27,7 +27,6 @@ import freemarker.core.ParseException;
import freemarker.template.MalformedTemplateNameException; import freemarker.template.MalformedTemplateNameException;
import freemarker.template.TemplateNotFoundException; import freemarker.template.TemplateNotFoundException;
import net.mingsoft.base.constant.Const; import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.holder.DataHolder;
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.CategoryBean; import net.mingsoft.cms.bean.CategoryBean;

View File

@ -1,17 +1,17 @@
#spring:
# datasource:
# url: jdbc:mysql://192.168.0.8:3316/mcms-dev-5.2-8?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=true
# username: mcms
# password: mcms
# filters: wall,mergeStat
# type: com.alibaba.druid.pool.DruidDataSource
spring: spring:
datasource: datasource:
driver-class-name: oracle.jdbc.driver.OracleDriver url: jdbc:mysql://192.168.0.8:3316/mcms-dev-5.2-8?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=true
url: jdbc:oracle:thin:@192.168.0.7:1521:helowin
username: mcms username: mcms
password: mcms password: mcms
filters: wall,mergeStat filters: wall,mergeStat
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
#spring:
# datasource:
# driver-class-name: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.0.7:1521:helowin
# username: mcms
# password: mcms
# filters: wall,mergeStat
# type: com.alibaba.druid.pool.DruidDataSource

View File

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

View File

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