Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
ca13da45
Commit
ca13da45
authored
Jan 04, 2020
by
铭飞
Committed by
Gitee
Jan 04, 2020
Browse files
Options
Browse Files
Download
Plain Diff
!205 修复问题
Merge pull request !205 from 灰色DT/5.0.0
parents
18c092cd
ff9987b9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
86 additions
and
99 deletions
+86
-99
pom.xml
pom.xml
+6
-0
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+0
-0
IContentBiz.java
src/main/java/net/mingsoft/cms/biz/IContentBiz.java
+2
-1
ContentBizImpl.java
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
+4
-3
IContentDao.java
src/main/java/net/mingsoft/cms/dao/IContentDao.java
+2
-1
IContentDao.xml
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
+33
-60
CmsParserUtil.java
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
+4
-4
SwaggerConfig.java
src/main/java/net/mingsoft/config/SwaggerConfig.java
+2
-0
application.yml
src/main/resources/application.yml
+30
-28
main.ftl
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
+3
-2
No files found.
pom.xml
View file @
ca13da45
...
@@ -35,6 +35,12 @@
...
@@ -35,6 +35,12 @@
</repository>
</repository>
</repositories>
</repositories>
<dependencies>
<dependencies>
<!-- 8.0数据库取消下面注解-->
<!-- <dependency>-->
<!-- <groupId>mysql</groupId>-->
<!-- <artifactId>mysql-connector-java</artifactId>-->
<!-- <version>8.0.11</version>-->
<!-- </dependency>-->
<dependency>
<dependency>
<groupId>
net.mingsoft
</groupId>
<groupId>
net.mingsoft
</groupId>
<artifactId>
ms-mpeople
</artifactId>
<artifactId>
ms-mpeople
</artifactId>
...
...
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
ca13da45
This diff is collapsed.
Click to expand it.
src/main/java/net/mingsoft/cms/biz/IContentBiz.java
View file @
ca13da45
...
@@ -20,5 +20,5 @@ public interface IContentBiz extends IBaseBiz {
...
@@ -20,5 +20,5 @@ public interface IContentBiz extends IBaseBiz {
List
<
ContentBean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
);
List
<
ContentBean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
);
int
getSearchCount
(
ModelEntity
contentModel
,
Map
whereMap
,
int
appId
,
String
categoryIds
);
int
getSearchCount
(
ModelEntity
contentModel
,
List
diyList
,
Map
whereMap
,
int
appId
,
String
categoryIds
);
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
View file @
ca13da45
...
@@ -63,10 +63,10 @@ public class ContentBizImpl extends BaseBizImpl implements IContentBiz {
...
@@ -63,10 +63,10 @@ public class ContentBizImpl extends BaseBizImpl implements IContentBiz {
}
}
@Override
@Override
public
int
getSearchCount
(
ModelEntity
contentModel
,
Map
whereMap
,
int
appId
,
String
categoryIds
)
{
public
int
getSearchCount
(
ModelEntity
contentModel
,
List
diyList
,
Map
whereMap
,
int
appId
,
String
categoryIds
)
{
if
(
contentModel
!=
null
)
{
if
(
contentModel
!=
null
)
{
return
contentDao
.
getSearchCount
(
contentModel
.
getModelTableName
(),
whereMap
,
appId
,
categoryIds
);
return
contentDao
.
getSearchCount
(
contentModel
.
getModelTableName
(),
diyList
,
whereMap
,
appId
,
categoryIds
);
}
}
return
contentDao
.
getSearchCount
(
null
,
whereMap
,
appId
,
categoryIds
);
return
contentDao
.
getSearchCount
(
null
,
null
,
whereMap
,
appId
,
categoryIds
);
}
}
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/dao/IContentDao.java
View file @
ca13da45
...
@@ -34,6 +34,6 @@ public interface IContentDao extends IBaseDao {
...
@@ -34,6 +34,6 @@ public interface IContentDao extends IBaseDao {
* list[2]:是否是等值查询 list[3]:字段的值
* list[2]:是否是等值查询 list[3]:字段的值
* @return 文章实体总数
* @return 文章实体总数
*/
*/
int
getSearchCount
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"
map"
)
Map
<
String
,
Lis
t
>
map
,
int
getSearchCount
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"
diyList"
)
List
diyList
,
@Param
(
"map"
)
Map
<
String
,
Objec
t
>
map
,
@Param
(
"websiteId"
)
int
websiteId
,
@Param
(
"ids"
)
String
ids
);
@Param
(
"websiteId"
)
int
websiteId
,
@Param
(
"ids"
)
String
ids
);
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
ca13da45
...
@@ -254,71 +254,43 @@
...
@@ -254,71 +254,43 @@
left join cms_category c
left join cms_category c
ON a.content_category_id
ON a.content_category_id
= c.id
= c.id
<if
test=
"tableName!=null and tableName!=''"
>
left join ${tableName} d on d.link_id=a.id
<if
test=
"tableName!=null and tableName!=''
and diyMap!=null
"
>
left join ${tableName} d on d.link_id=a.id
</if>
</if>
where a.app_id = #{websiteId}
<where>
<if
test=
"ids!=null and ids!=''"
>
a.app_id = #{websiteId}
and FIND_IN_SET(content_category_id,'${ids}')
<if
test=
"ids!=null and ids!=''"
>
</if>
and FIND_IN_SET(content_category_id,'${ids}')
<foreach
item=
"item"
index=
"key"
collection=
"map"
open=
""
</if>
separator=
""
close=
""
>
<if
test=
"map.content_title!=null"
>
<if
test=
" item[0] == false"
>
and a.content_title like CONCAT("%",'${map.content_title}',"%")
and ${key}
</if>
<if
test=
"map.content_author!=null"
>
and a.content_author like CONCAT("%",'${map.content_author}',"%")
</if>
<if
test=
"map.content_source!=null"
>
and a.content_source like CONCAT("%",'${map.content_source}',"%")
</if>
<if
test=
"map.content_type!=null"
>
and a.content_type like CONCAT("%",'${map.content_type}',"%")
</if>
<if
test=
"map.content_description!=null"
>
and a.content_description like CONCAT("%",'${map.content_description}',"%")
</if>
</if>
<if
test=
"
item[0]== true
"
>
<if
test=
"
map.content_keyword!=null
"
>
and d.${key}
and a.content_keyword like CONCAT("%",'${map.content_keyword}',"%")
</if>
</if>
<!-- 数字类型的查找 item[1]:字段是否为数字类型false:数字 -->
<if
test=
"map.content_details!=null"
>
<if
test=
"item[1] == false"
>
and a.content_details like CONCAT("%",'${map.content_details}',"%")
<!--item[2]: 是采用等值还是区间查询。false:区间 itme[3][0]第一个值item[3][1]的二个值 -->
<if
test=
"item[2] == true"
>
=
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
#{val}
</foreach>
</if>
<if
test=
"item[2] == false"
>
between
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
separator=
"and"
>
#{val}
</foreach>
</if>
</if>
</if>
<!-- 字符型数据的查找 item[1]:字段是否为数字类型true:字符串 -->
<if
test=
"tableName!=null and tableName!='' and diyMap!=null"
>
<if
test=
"item[1] == true"
>
<foreach
item=
"item"
index=
"index"
collection=
"diyList"
open=
""
<!--item[2]: 是采用模糊查询。false:不采用模糊 -->
separator=
""
close=
""
>
<if
test=
"item[2] == true"
>
and d.${item.key} like CONCAT("%",'${item.value}',"%")
<include
refid=
"queryLike"
></include>
</foreach>
</if>
<if
test=
"item[2] == false"
>
=
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
#{val}
</foreach>
</if>
</if>
</if>
</foreach>
</where>
</select>
</select>
<!-- 根据字段条件查找文章实体开始 -->
<sql
id=
"queryLike"
databaseId=
"mysql"
>
like CONCAT("%",
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
<if
test=
"index==0"
>
#{val}
</if>
</foreach>
,"%")
</sql>
<sql
id=
"queryLike"
databaseId=
"oracle"
>
like '%'||
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
<if
test=
"index==0"
>
#{val}
</if>
</foreach>
||'%'
</sql>
<sql
id=
"queryLike"
databaseId=
"sqlServer"
>
like '%'+
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
<if
test=
"index==0"
>
#{val}
</if>
</foreach>
+'%'
</sql>
</mapper>
</mapper>
\ No newline at end of file
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
ca13da45
...
@@ -38,7 +38,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -38,7 +38,7 @@ public class CmsParserUtil extends ParserUtil {
/**
/**
* 指定模板,指定路径进行生成静态页面,会自定识别pc与移动端
* 指定模板,指定路径进行生成静态页面,会自定识别pc与移动端
*
*
* @param templatePath
* @param templatePath
* 模板路径
* 模板路径
* @param targetPath
* @param targetPath
...
@@ -53,7 +53,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -53,7 +53,7 @@ public class CmsParserUtil extends ParserUtil {
map
.
put
(
COLUMN
,
column
);
map
.
put
(
COLUMN
,
column
);
String
content
=
CmsParserUtil
.
generate
(
templatePath
,
map
,
false
);
String
content
=
CmsParserUtil
.
generate
(
templatePath
,
map
,
false
);
FileUtil
.
writeString
(
content
,
ParserUtil
.
buildHtmlPath
(
targetPath
),
Const
.
UTF8
);
FileUtil
.
writeString
(
content
,
ParserUtil
.
buildHtmlPath
(
targetPath
),
Const
.
UTF8
);
// 生成移动页面
// 生成移动页面
if
(
ParserUtil
.
hasMobileFile
(
templatePath
))
{
if
(
ParserUtil
.
hasMobileFile
(
templatePath
))
{
// 手机端m
// 手机端m
...
@@ -188,7 +188,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -188,7 +188,7 @@ public class CmsParserUtil extends ParserUtil {
/**
/**
* 生成内容
* 生成内容
*
*
* @param articleIdList
* @param articleIdList
* 文章集合
* 文章集合
* @return
* @return
...
@@ -227,7 +227,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -227,7 +227,7 @@ public class CmsParserUtil extends ParserUtil {
}
}
// 判断文件是否存在,若不存在弹出返回信息
// 判断文件是否存在,若不存在弹出返回信息
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
columnUrl
)))
{
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
columnUrl
))
||
StringUtils
.
isBlank
(
articleIdList
.
get
(
artId
).
getCategoryId
())
)
{
artId
++;
artId
++;
continue
;
continue
;
}
}
...
...
src/main/java/net/mingsoft/config/SwaggerConfig.java
View file @
ca13da45
package
net
.
mingsoft
.
config
;
package
net
.
mingsoft
.
config
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
...
@@ -13,6 +14,7 @@ import springfox.documentation.spring.web.plugins.Docket;
...
@@ -13,6 +14,7 @@ import springfox.documentation.spring.web.plugins.Docket;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Configuration
@Configuration
@ConditionalOnProperty
(
prefix
=
"ms"
,
name
=
"swagger.enable"
,
havingValue
=
"true"
)
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
@Bean
@Bean
...
...
src/main/resources/application.yml
View file @
ca13da45
...
@@ -2,29 +2,32 @@ server:
...
@@ -2,29 +2,32 @@ server:
port
:
8080
port
:
8080
servlet.context-path
:
/ms-mcms
servlet.context-path
:
/ms-mcms
servlet.session.timeout
:
60M
servlet.session.timeout
:
60M
logging
:
logging
:
level
:
level
:
net.mingsoft
:
trace
net.mingsoft
:
trace
file
:
mcms.log
#日志文件存放位置
path
:
log
#日志压缩文件存放位置
ms
:
ms
:
manager
:
swagger
:
path
:
/ms
enable
:
true
#启用swagger文档
view-path
:
/WEB-INF/manager
manager
:
path
:
/ms
upload
:
view-path
:
/WEB-INF/manager
path
:
upload
mapping
:
/upload/**
denied
:
.exe,.jsp
multipart
:
#最大上传文件大小 单位:KB
max-file-size
:
10240
#文件暂存临时目录
upload-temp-dir
:
temp
#临时文件大小
max-in-memory-size
:
10240
#总上传最大大小 单位:KB -1禁用
max-request-size
:
-1
upload
:
path
:
upload
mapping
:
/upload/**
denied
:
.exe,.jsp
multipart
:
#最大上传文件大小 单位:KB
max-file-size
:
10240
#文件暂存临时目录
upload-temp-dir
:
temp
#临时文件大小
max-in-memory-size
:
10240
#总上传最大大小 单位:KB -1禁用
max-request-size
:
-1
...
@@ -32,8 +35,8 @@ spring:
...
@@ -32,8 +35,8 @@ spring:
profiles
:
profiles
:
active
:
dev
active
:
dev
mvc
:
mvc
:
pathmatch
:
pathmatch
:
use-suffix-pattern
:
true
use-suffix-pattern
:
true
devtools
:
devtools
:
restart
:
restart
:
enabled
:
true
enabled
:
true
...
@@ -54,7 +57,7 @@ spring:
...
@@ -54,7 +57,7 @@ spring:
expose-spring-macro-helpers
:
true
expose-spring-macro-helpers
:
true
prefer-file-system-access
:
false
prefer-file-system-access
:
false
template-loader-path
:
classpath:/WEB-INF/manager,classpath:/WEB-INF
template-loader-path
:
classpath:/WEB-INF/manager,classpath:/WEB-INF
settings
:
settings
:
template_update_delay
:
1
template_update_delay
:
1
default_encoding
:
UTF-8
default_encoding
:
UTF-8
classic_compatible
:
true
classic_compatible
:
true
...
@@ -62,8 +65,7 @@ spring:
...
@@ -62,8 +65,7 @@ spring:
time_format
:
HH:mm:ss
time_format
:
HH:mm:ss
datetime_format
:
yyyy-MM-dd HH:mm:ss
datetime_format
:
yyyy-MM-dd HH:mm:ss
number_format
:
0.##
number_format
:
0.##
mybatis
:
mybatis
:
mapper-locations
:
classpath*:**/dao/*.xml
configuration
:
configuration
:
database-id
:
mysql
database-id
:
mysql
\ No newline at end of file
\ No newline at end of file
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
View file @
ca13da45
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<title>
文章主体
</title>
<title>
文章主体
</title>
<
#
include
"../../
include
/
head-file
.
ftl
"
>
<
#
include
"../../
include
/
head-file
.
ftl
"
>
<
#
include
"../../
include
/
increase-search
.
ftl
"
>
<
#
include
"../../
include
/
increase-search
.
ftl
"
>
</head>
</head>
<body>
<body>
<div
id=
"main"
class=
"ms-index"
v-cloak
>
<div
id=
"main"
class=
"ms-index"
v-cloak
>
...
@@ -124,8 +125,8 @@
...
@@ -124,8 +125,8 @@
data
:{
data
:{
conditionList
:[
conditionList
:[
{
action
:
'and'
,
field
:
'content_title'
,
el
:
'eq'
,
model
:
'contentTitle'
,
name
:
'文章标题'
,
type
:
'input'
},
{
action
:
'and'
,
field
:
'content_title'
,
el
:
'eq'
,
model
:
'contentTitle'
,
name
:
'文章标题'
,
type
:
'input'
},
{
action
:
'and'
,
field
:
'content_category_id'
,
el
:
'eq'
,
model
:
'contentCategoryId'
,
name
:
'所属栏目'
,
type
:
'cascader'
,
multiple
:
false
},
{
action
:
'and'
,
field
:
'content_category_id'
,
el
:
'eq'
,
model
:
'contentCategoryId'
,
name
:
'所属栏目'
,
key
:
'id'
,
title
:
'categoryTitle'
,
type
:
'cascader'
,
multiple
:
false
},
{
action
:
'and'
,
field
:
'content_type'
,
el
:
'eq'
,
model
:
'contentType'
,
name
:
'文章类型'
,
type
:
'checkbox'
,
label
:
false
,
multiple
:
true
},
{
action
:
'and'
,
field
:
'content_type'
,
el
:
'eq'
,
model
:
'contentType'
,
name
:
'文章类型'
,
key
:
'dictValue'
,
title
:
'dictLabel'
,
type
:
'checkbox'
,
label
:
false
,
multiple
:
true
},
{
action
:
'and'
,
field
:
'content_display'
,
el
:
'eq'
,
model
:
'contentDisplay'
,
name
:
'是否显示'
,
type
:
'radio'
,
label
:
true
,
multiple
:
false
},
{
action
:
'and'
,
field
:
'content_display'
,
el
:
'eq'
,
model
:
'contentDisplay'
,
name
:
'是否显示'
,
type
:
'radio'
,
label
:
true
,
multiple
:
false
},
{
action
:
'and'
,
field
:
'content_author'
,
el
:
'eq'
,
model
:
'contentAuthor'
,
name
:
'文章作者'
,
type
:
'input'
},
{
action
:
'and'
,
field
:
'content_author'
,
el
:
'eq'
,
model
:
'contentAuthor'
,
name
:
'文章作者'
,
type
:
'input'
},
{
action
:
'and'
,
field
:
'content_source'
,
el
:
'eq'
,
model
:
'contentSource'
,
name
:
'文章来源'
,
type
:
'input'
},
{
action
:
'and'
,
field
:
'content_source'
,
el
:
'eq'
,
model
:
'contentSource'
,
name
:
'文章来源'
,
type
:
'input'
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment