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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
44 deletions
+35
-44
pom.xml
pom.xml
+5
-34
GeneraterAction.java
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
+17
-7
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 @@
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"
>
<parent>
<groupId>
org.springframework.boo
t
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.
2.2.RELEASE
</version>
<groupId>
net.mingsof
t
</groupId>
<artifactId>
ms-pom
</artifactId>
<version>
2.
0.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
net.mingsoft
</groupId>
<artifactId>
mcms
</artifactId>
<version>
5.
0.0
</version>
<version>
5.
1-SNAPSHOT
</version>
<name>
ms-mcms
</name>
<properties>
<java.version>
1.8
</java.version>
</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>
<dependency>
<groupId>
net.mingsoft
</groupId>
<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>
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
<dependency>
...
...
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
8a28ed1b
...
...
@@ -36,6 +36,7 @@ import net.mingsoft.cms.util.CmsParserUtil;
import
net.mingsoft.mdiy.bean.AttributeBean
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.util.ParserUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -173,9 +174,13 @@ public class GeneraterAction extends BaseAction {
// 1、设置模板文件夹路径
// 获取栏目列表模版
for
(
CategoryEntity
column
:
columns
)
{
ContentBean
contentBean
=
new
ContentBean
();
contentBean
.
setContentCategoryId
(
column
.
getId
());
// 分类是列表,链接
if
(!
column
.
getCategoryType
().
equals
(
"2"
))
{
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
column
.
getCategory
Url
())))
{
LOG
.
error
(
"模板不存在:{}"
,
column
.
getCategoryUrl
());
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
column
.
getCategoryList
Url
())))
{
LOG
.
error
(
"模板不存在:{}"
,
column
.
getCategoryUrl
());
continue
;
}
//获取模板中列表标签中的条件
...
...
@@ -185,15 +190,14 @@ public class GeneraterAction extends BaseAction {
map
.
put
(
ParserUtil
.
HTML
,
ParserUtil
.
HTML
);
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
map
.
put
(
ParserUtil
.
PAGE
,
page
);
ContentBean
contentBean
=
new
ContentBean
();
contentBean
.
setContentCategoryId
(
column
.
getId
());
AttributeBean
attributeBean
=
new
AttributeBean
();
// 获取文章列表模板标签属性
ParserUtil
.
read
(
column
.
getCategoryListUrl
(),
map
,
page
,
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
);
// 判断列表类型
switch
(
column
.
getCategoryType
())
{
...
...
@@ -249,8 +253,10 @@ public class GeneraterAction extends BaseAction {
categoryList
=
categoryBiz
.
query
(
categoryEntity
);
for
(
CategoryEntity
category
:
categoryList
){
contentBean
.
setContentCategoryId
(
category
.
getId
());
// 分类是列表,链接
if
(!
category
.
getCategoryType
().
equals
(
"2"
)){
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
category
.
getCategoryUrl
()
)))
{
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
category
.
getCategoryListUrl
()))
||
StringUtils
.
isEmpty
(
category
.
getCategoryListUrl
(
)))
{
LOG
.
error
(
"模板不存在:{}"
,
category
.
getCategoryUrl
());
continue
;
}
...
...
@@ -260,6 +266,7 @@ public class GeneraterAction extends BaseAction {
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
}
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
// 有符合条件的就更新
if
(
articleIdList
.
size
()
>
0
)
{
...
...
@@ -268,6 +275,9 @@ public class GeneraterAction extends BaseAction {
}
}
else
{
CategoryEntity
category
=
(
CategoryEntity
)
categoryBiz
.
getEntity
(
Integer
.
parseInt
(
columnId
));
contentBean
.
setContentCategoryId
(
columnId
);
// 分类是列表,链接
if
(!
category
.
getCategoryType
().
equals
(
"2"
)){
// 获取文章列表表属性
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
category
.
getCategoryUrl
())))
{
...
...
@@ -279,7 +289,7 @@ public class GeneraterAction extends BaseAction {
contentBean
.
setNoflag
(
attributeBean
.
getNoflag
());
contentBean
.
setOrder
(
attributeBean
.
getOrder
());
contentBean
.
setOrderBy
(
attributeBean
.
getOrderby
());
contentBean
.
setContentCategoryId
(
columnId
);
}
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
// 有符合条件的就更新
if
(
articleIdList
.
size
()
>
0
)
{
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
8a28ed1b
...
...
@@ -276,10 +276,20 @@
and (cms_content.content_type not in ( #{noflag} ) or cms_content.content_type is null)
</if>
<if
test=
"orderBy!=null and orderBy!='' "
>
ORDER BY ${orderBy}
<if
test=
"order!=null and order!=''"
>
${order}
<if
test=
"orderBy=='date'"
>
ORDER BY content_datetime
</if>
<if
test=
"orderBy=='hit'"
>
ORDER BY content_hit
</if>
<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>
<choose>
<when
test=
"order!=null and order!=''"
>
${order}
</when>
<otherwise>
desc
</otherwise>
</choose>
</if>
</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