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
8a28ed1b
Commit
8a28ed1b
authored
Sep 02, 2020
by
luoxj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
列表排序
parent
588d0791
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
77 deletions
+68
-77
pom.xml
pom.xml
+5
-34
GeneraterAction.java
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
+50
-40
IContentDao.xml
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
+13
-3
No files found.
pom.xml
View file @
8a28ed1b
...
@@ -3,52 +3,23 @@
...
@@ -3,52 +3,23 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<parent>
<groupId>
org.springframework.boo
t
</groupId>
<groupId>
net.mingsof
t
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<artifactId>
ms-pom
</artifactId>
<version>
2.
2.2.RELEASE
</version>
<version>
2.
0.0-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
net.mingsoft
</groupId>
<groupId>
net.mingsoft
</groupId>
<artifactId>
mcms
</artifactId>
<artifactId>
mcms
</artifactId>
<version>
5.
0.0
</version>
<version>
5.
1-SNAPSHOT
</version>
<name>
ms-mcms
</name>
<name>
ms-mcms
</name>
<properties>
<properties>
<java.version>
1.8
</java.version>
<java.version>
1.8
</java.version>
</properties>
</properties>
<repositories>
<repository>
<id>
sonatype-nexus-snapshots
</id>
<name>
Sonatype Nexus Snapshots
</name>
<url>
http://repo1.maven.org/maven2/
</url>
<releases>
<enabled>
true
</enabled>
</releases>
<snapshots>
<enabled>
true
</enabled>
</snapshots>
</repository>
<repository>
<id>
sonatype
</id>
<name>
Sonatype Snapshots
</name>
<url>
https://oss.sonatype.org/content/groups/public/
</url>
<releases>
<enabled>
true
</enabled>
</releases>
<snapshots>
<enabled>
true
</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
net.mingsoft
</groupId>
<groupId>
net.mingsoft
</groupId>
<artifactId>
ms-mpeople
</artifactId>
<artifactId>
ms-mpeople
</artifactId>
<version>
1.0.24
</version>
</dependency>
<dependency>
<groupId>
net.mingsoft
</groupId>
<artifactId>
ms-basic
</artifactId>
<version>
1.0.30-SNAPSHOT
</version>
</dependency>
</dependency>
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
<dependency>
<dependency>
...
...
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
8a28ed1b
...
@@ -36,6 +36,7 @@ import net.mingsoft.cms.util.CmsParserUtil;
...
@@ -36,6 +36,7 @@ import net.mingsoft.cms.util.CmsParserUtil;
import
net.mingsoft.mdiy.bean.AttributeBean
;
import
net.mingsoft.mdiy.bean.AttributeBean
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.util.ParserUtil
;
import
net.mingsoft.mdiy.util.ParserUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -173,27 +174,30 @@ public class GeneraterAction extends BaseAction {
...
@@ -173,27 +174,30 @@ public class GeneraterAction extends BaseAction {
// 1、设置模板文件夹路径
// 1、设置模板文件夹路径
// 获取栏目列表模版
// 获取栏目列表模版
for
(
CategoryEntity
column
:
columns
)
{
for
(
CategoryEntity
column
:
columns
)
{
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
column
.
getCategoryUrl
())))
{
LOG
.
error
(
"模板不存在:{}"
,
column
.
getCategoryUrl
());
continue
;
}
//获取模板中列表标签中的条件
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
ParserUtil
.
APP_ID
,
BasicUtil
.
getAppId
());
PageBean
page
=
new
PageBean
();
map
.
put
(
ParserUtil
.
HTML
,
ParserUtil
.
HTML
);
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
map
.
put
(
ParserUtil
.
PAGE
,
page
);
ContentBean
contentBean
=
new
ContentBean
();
ContentBean
contentBean
=
new
ContentBean
();
contentBean
.
setContentCategoryId
(
column
.
getId
());
contentBean
.
setContentCategoryId
(
column
.
getId
());
AttributeBean
attributeBean
=
new
AttributeBean
();
// 分类是列表,链接
// 获取文章列表模板标签属性
if
(!
column
.
getCategoryType
().
equals
(
"2"
))
{
ParserUtil
.
read
(
column
.
getCategoryListUrl
(),
map
,
page
,
attributeBean
);
// 判断模板文件是否存在
contentBean
.
setFlag
(
attributeBean
.
getFlag
());
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
column
.
getCategoryListUrl
())))
{
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
LOG
.
error
(
"模板不存在:{}"
,
column
.
getCategoryUrl
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
continue
;
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
}
//获取模板中列表标签中的条件
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
ParserUtil
.
APP_ID
,
BasicUtil
.
getAppId
());
PageBean
page
=
new
PageBean
();
map
.
put
(
ParserUtil
.
HTML
,
ParserUtil
.
HTML
);
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
map
.
put
(
ParserUtil
.
PAGE
,
page
);
AttributeBean
attributeBean
=
new
AttributeBean
();
// 获取文章列表模板标签属性
ParserUtil
.
read
(
column
.
getCategoryListUrl
(),
map
,
page
,
attributeBean
);
contentBean
.
setFlag
(
attributeBean
.
getFlag
());
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
}
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
// 判断列表类型
// 判断列表类型
switch
(
column
.
getCategoryType
())
{
switch
(
column
.
getCategoryType
())
{
...
@@ -249,17 +253,20 @@ public class GeneraterAction extends BaseAction {
...
@@ -249,17 +253,20 @@ public class GeneraterAction extends BaseAction {
categoryList
=
categoryBiz
.
query
(
categoryEntity
);
categoryList
=
categoryBiz
.
query
(
categoryEntity
);
for
(
CategoryEntity
category
:
categoryList
){
for
(
CategoryEntity
category
:
categoryList
){
contentBean
.
setContentCategoryId
(
category
.
getId
());
contentBean
.
setContentCategoryId
(
category
.
getId
());
// 判断模板文件是否存在
// 分类是列表,链接
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
category
.
getCategoryUrl
())))
{
if
(!
category
.
getCategoryType
().
equals
(
"2"
)){
LOG
.
error
(
"模板不存在:{}"
,
category
.
getCategoryUrl
());
// 判断模板文件是否存在
continue
;
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
category
.
getCategoryListUrl
()))
||
StringUtils
.
isEmpty
(
category
.
getCategoryListUrl
()))
{
LOG
.
error
(
"模板不存在:{}"
,
category
.
getCategoryUrl
());
continue
;
}
// 获取文章列表表属性
ParserUtil
.
read
(
category
.
getCategoryListUrl
(),
map
,
page
,
attributeBean
);
contentBean
.
setFlag
(
attributeBean
.
getFlag
());
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
}
}
// 获取文章列表表属性
ParserUtil
.
read
(
category
.
getCategoryListUrl
(),
map
,
page
,
attributeBean
);
contentBean
.
setFlag
(
attributeBean
.
getFlag
());
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
// 有符合条件的就更新
// 有符合条件的就更新
if
(
articleIdList
.
size
()
>
0
)
{
if
(
articleIdList
.
size
()
>
0
)
{
...
@@ -268,18 +275,21 @@ public class GeneraterAction extends BaseAction {
...
@@ -268,18 +275,21 @@ public class GeneraterAction extends BaseAction {
}
}
}
else
{
}
else
{
CategoryEntity
category
=
(
CategoryEntity
)
categoryBiz
.
getEntity
(
Integer
.
parseInt
(
columnId
));
CategoryEntity
category
=
(
CategoryEntity
)
categoryBiz
.
getEntity
(
Integer
.
parseInt
(
columnId
));
// 获取文章列表表属性
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
category
.
getCategoryUrl
())))
{
LOG
.
error
(
"模板不存在:{}"
,
category
.
getCategoryUrl
());
return
;
}
ParserUtil
.
read
(
category
.
getCategoryListUrl
(),
map
,
page
,
attributeBean
);
contentBean
.
setFlag
(
attributeBean
.
getFlag
());
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
contentBean
.
setContentCategoryId
(
columnId
);
contentBean
.
setContentCategoryId
(
columnId
);
// 分类是列表,链接
if
(!
category
.
getCategoryType
().
equals
(
"2"
)){
// 获取文章列表表属性
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
category
.
getCategoryUrl
())))
{
LOG
.
error
(
"模板不存在:{}"
,
category
.
getCategoryUrl
());
return
;
}
ParserUtil
.
read
(
category
.
getCategoryListUrl
(),
map
,
page
,
attributeBean
);
contentBean
.
setFlag
(
attributeBean
.
getFlag
());
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
}
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
// 有符合条件的就更新
// 有符合条件的就更新
if
(
articleIdList
.
size
()
>
0
)
{
if
(
articleIdList
.
size
()
>
0
)
{
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
8a28ed1b
...
@@ -276,10 +276,20 @@
...
@@ -276,10 +276,20 @@
and (cms_content.content_type not in ( #{noflag} ) or cms_content.content_type is null)
and (cms_content.content_type not in ( #{noflag} ) or cms_content.content_type is null)
</if>
</if>
<if
test=
"orderBy!=null and orderBy!='' "
>
<if
test=
"orderBy!=null and orderBy!='' "
>
ORDER BY ${orderBy}
<if
test=
"orderBy=='date'"
>
ORDER BY content_datetime
</if>
<if
test=
"order!=null and order!=''"
>
<if
test=
"orderBy=='hit'"
>
ORDER BY content_hit
</if>
${order}
<if
test=
"orderBy=='sort'"
>
ORDER BY content_sort
</if>
<if
test=
"orderBy!='date' and orderBy!='hit' and orderBy!='sort'"
>
ORDER BY cms_content.id
</if>
</if>
<choose>
<when
test=
"order!=null and order!=''"
>
${order}
</when>
<otherwise>
desc
</otherwise>
</choose>
</if>
</if>
</select>
</select>
...
...
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