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
6fd16fbd
Commit
6fd16fbd
authored
Aug 27, 2020
by
luoxj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文章列表接口增加静态地址
parent
eccc7c69
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
46 deletions
+97
-46
GeneraterAction.java
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
+4
-4
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+5
-5
CategoryBean.java
src/main/java/net/mingsoft/cms/bean/CategoryBean.java
+29
-0
ContentBean.java
src/main/java/net/mingsoft/cms/bean/ContentBean.java
+16
-19
IContentBiz.java
src/main/java/net/mingsoft/cms/biz/IContentBiz.java
+4
-3
ContentBizImpl.java
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
+4
-4
IContentDao.java
src/main/java/net/mingsoft/cms/dao/IContentDao.java
+2
-2
IContentDao.xml
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
+29
-3
CmsParserUtil.java
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
+4
-6
No files found.
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
6fd16fbd
...
@@ -27,7 +27,7 @@ import cn.hutool.core.io.FileUtil;
...
@@ -27,7 +27,7 @@ import cn.hutool.core.io.FileUtil;
import
net.mingsoft.basic.biz.IModelBiz
;
import
net.mingsoft.basic.biz.IModelBiz
;
import
net.mingsoft.basic.entity.AppEntity
;
import
net.mingsoft.basic.entity.AppEntity
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.cms.bean.C
ontent
Bean
;
import
net.mingsoft.cms.bean.C
ategory
Bean
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.cms.entity.CategoryEntity
;
...
@@ -163,7 +163,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -163,7 +163,7 @@ public class GeneraterAction extends BaseAction {
categoryEntity
.
setAppId
(
app
.
getAppId
());
categoryEntity
.
setAppId
(
app
.
getAppId
());
columns
=
categoryBiz
.
query
(
categoryEntity
);
columns
=
categoryBiz
.
query
(
categoryEntity
);
}
}
List
<
C
ontent
Bean
>
articleIdList
=
null
;
List
<
C
ategory
Bean
>
articleIdList
=
null
;
try
{
try
{
// 1、设置模板文件夹路径
// 1、设置模板文件夹路径
// 获取栏目列表模版
// 获取栏目列表模版
...
@@ -182,7 +182,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -182,7 +182,7 @@ public class GeneraterAction extends BaseAction {
break
;
break
;
case
"2"
:
// 单页
case
"2"
:
// 单页
if
(
articleIdList
.
size
()==
0
){
if
(
articleIdList
.
size
()==
0
){
C
ontentBean
columnArticleIdBean
=
new
Content
Bean
();
C
ategoryBean
columnArticleIdBean
=
new
Category
Bean
();
CopyOptions
copyOptions
=
CopyOptions
.
create
();
CopyOptions
copyOptions
=
CopyOptions
.
create
();
copyOptions
.
setIgnoreError
(
true
);
copyOptions
.
setIgnoreError
(
true
);
BeanUtil
.
copyProperties
(
column
,
columnArticleIdBean
,
copyOptions
);
BeanUtil
.
copyProperties
(
column
,
columnArticleIdBean
,
copyOptions
);
...
@@ -212,7 +212,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -212,7 +212,7 @@ public class GeneraterAction extends BaseAction {
public
void
generateArticle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
String
columnId
)
{
public
void
generateArticle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
String
columnId
)
{
String
dateTime
=
request
.
getParameter
(
"dateTime"
);
String
dateTime
=
request
.
getParameter
(
"dateTime"
);
// 网站风格物理路径
// 网站风格物理路径
List
<
C
ontent
Bean
>
articleIdList
=
null
;
List
<
C
ategory
Bean
>
articleIdList
=
null
;
// 查出所有文章(根据选择栏目)包括子栏目
// 查出所有文章(根据选择栏目)包括子栏目
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
columnId
,
dateTime
,
null
);
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
columnId
,
dateTime
,
null
);
// 有符合条件的新闻就更新
// 有符合条件的新闻就更新
...
...
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
6fd16fbd
...
@@ -29,7 +29,7 @@ import freemarker.template.TemplateNotFoundException;
...
@@ -29,7 +29,7 @@ import freemarker.template.TemplateNotFoundException;
import
net.mingsoft.base.constant.Const
;
import
net.mingsoft.base.constant.Const
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.StringUtil
;
import
net.mingsoft.basic.util.StringUtil
;
import
net.mingsoft.cms.bean.C
ontent
Bean
;
import
net.mingsoft.cms.bean.C
ategory
Bean
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.cms.entity.CategoryEntity
;
...
@@ -143,7 +143,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -143,7 +143,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
int
size
=
BasicUtil
.
getInt
(
ParserUtil
.
SIZE
,
10
);
int
size
=
BasicUtil
.
getInt
(
ParserUtil
.
SIZE
,
10
);
//获取文章总数
//获取文章总数
List
<
C
ontent
Bean
>
columnArticles
=
contentBiz
.
queryIdsByCategoryIdForParser
(
String
.
valueOf
(
typeId
),
null
,
null
);
List
<
C
ategory
Bean
>
columnArticles
=
contentBiz
.
queryIdsByCategoryIdForParser
(
String
.
valueOf
(
typeId
),
null
,
null
);
//判断栏目下是否有文章
//判断栏目下是否有文章
if
(
columnArticles
.
size
()==
0
){
if
(
columnArticles
.
size
()==
0
){
this
.
outJson
(
resp
,
false
);
this
.
outJson
(
resp
,
false
);
...
@@ -220,7 +220,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -220,7 +220,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
map
.
put
(
ParserUtil
.
PAGE
,
page
);
map
.
put
(
ParserUtil
.
PAGE
,
page
);
map
.
put
(
ParserUtil
.
ID
,
article
.
getId
());
map
.
put
(
ParserUtil
.
ID
,
article
.
getId
());
List
<
C
ontent
Bean
>
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
column
.
getCategoryId
(),
null
,
null
,
orderby
,
order
);
List
<
C
ategory
Bean
>
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
column
.
getCategoryId
(),
null
,
null
,
orderby
,
order
);
Map
<
Object
,
Object
>
contentModelMap
=
new
HashMap
<
Object
,
Object
>();
Map
<
Object
,
Object
>
contentModelMap
=
new
HashMap
<
Object
,
Object
>();
ModelEntity
contentModel
=
null
;
ModelEntity
contentModel
=
null
;
for
(
int
artId
=
0
;
artId
<
articleIdList
.
size
();)
{
for
(
int
artId
=
0
;
artId
<
articleIdList
.
size
();)
{
...
@@ -250,7 +250,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -250,7 +250,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
}
// 第一篇文章没有上一篇
// 第一篇文章没有上一篇
if
(
artId
>
0
)
{
if
(
artId
>
0
)
{
C
ontent
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
C
ategory
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
preCaBean
.
getCategoryId
()+
""
)){
if
(
articleColumnPath
.
contains
(
preCaBean
.
getCategoryId
()+
""
)){
page
.
setPreId
(
preCaBean
.
getArticleId
());
page
.
setPreId
(
preCaBean
.
getArticleId
());
...
@@ -258,7 +258,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -258,7 +258,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
}
// 最后一篇文章没有下一篇
// 最后一篇文章没有下一篇
if
(
artId
+
1
<
articleIdList
.
size
())
{
if
(
artId
+
1
<
articleIdList
.
size
())
{
C
ontent
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
C
ategory
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
nextCaBean
.
getCategoryId
()+
""
)){
if
(
articleColumnPath
.
contains
(
nextCaBean
.
getCategoryId
()+
""
)){
page
.
setNextId
(
nextCaBean
.
getArticleId
());
page
.
setNextId
(
nextCaBean
.
getArticleId
());
...
...
src/main/java/net/mingsoft/cms/bean/CategoryBean.java
0 → 100644
View file @
6fd16fbd
package
net
.
mingsoft
.
cms
.
bean
;
import
net.mingsoft.cms.entity.CategoryEntity
;
/**
* 文章实体
* @author 铭飞开发团队
* 创建日期:2019-11-28 15:12:32<br/>
* 历史修订:<br/>
*/
public
class
CategoryBean
extends
CategoryEntity
{
/**
* 文章编号
*/
private
int
articleId
;
public
int
getArticleId
()
{
return
articleId
;
}
public
void
setArticleId
(
int
articleId
)
{
this
.
articleId
=
articleId
;
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/bean/ContentBean.java
View file @
6fd16fbd
package
net
.
mingsoft
.
cms
.
bean
;
package
net
.
mingsoft
.
cms
.
bean
;
import
net.mingsoft.cms.entity.C
ategory
Entity
;
import
net.mingsoft.cms.entity.C
ontent
Entity
;
/**
/**
* 文章实体
* 文章实体bean
* @author 铭飞开发团队
*/
* 创建日期:2019-11-28 15:12:32<br/>
public
class
ContentBean
extends
ContentEntity
{
* 历史修订:<br/>
*/
public
class
ContentBean
extends
CategoryEntity
{
/**
/**
* 文章编号
* 静态化地址
*/
*/
private
int
articleId
;
private
String
staticUrl
;
public
int
getArticleId
()
{
return
articleId
;
}
public
void
setArticleId
(
int
articleId
)
{
public
String
getStaticUrl
()
{
this
.
articleId
=
articleId
;
return
staticUrl
;
}
}
}
\ No newline at end of file
public
void
setStaticUrl
(
String
staticUrl
)
{
this
.
staticUrl
=
staticUrl
;
}
}
src/main/java/net/mingsoft/cms/biz/IContentBiz.java
View file @
6fd16fbd
package
net
.
mingsoft
.
cms
.
biz
;
package
net
.
mingsoft
.
cms
.
biz
;
import
net.mingsoft.base.biz.IBaseBiz
;
import
net.mingsoft.base.biz.IBaseBiz
;
import
net.mingsoft.cms.bean.C
ontent
Bean
;
import
net.mingsoft.cms.bean.C
ategory
Bean
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
import
java.util.List
;
import
java.util.List
;
...
@@ -16,9 +16,9 @@ import java.util.Map;
...
@@ -16,9 +16,9 @@ import java.util.Map;
*/
*/
public
interface
IContentBiz
extends
IBaseBiz
{
public
interface
IContentBiz
extends
IBaseBiz
{
List
<
C
ontent
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
);
List
<
C
ategory
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
);
List
<
C
ontent
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
);
List
<
C
ategory
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
);
int
getSearchCount
(
ModelEntity
contentModel
,
List
diyList
,
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 @
6fd16fbd
...
@@ -22,14 +22,14 @@ The MIT License (MIT) * Copyright (c) 2019 铭飞科技
...
@@ -22,14 +22,14 @@ The MIT License (MIT) * Copyright (c) 2019 铭飞科技
package
net
.
mingsoft
.
cms
.
biz
.
impl
;
package
net
.
mingsoft
.
cms
.
biz
.
impl
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.cms.bean.C
ontent
Bean
;
import
net.mingsoft.cms.bean.C
ategory
Bean
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
net.mingsoft.base.biz.impl.BaseBizImpl
;
import
net.mingsoft.base.biz.impl.BaseBizImpl
;
import
net.mingsoft.base.dao.IBaseDao
;
import
net.mingsoft.base.dao.IBaseDao
;
import
java.util.*
;
import
java.util.*
;
import
net.mingsoft.cms.entity.ContentEntity
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.dao.IContentDao
;
import
net.mingsoft.cms.dao.IContentDao
;
...
@@ -54,11 +54,11 @@ public class ContentBizImpl extends BaseBizImpl implements IContentBiz {
...
@@ -54,11 +54,11 @@ public class ContentBizImpl extends BaseBizImpl implements IContentBiz {
}
}
@Override
@Override
public
List
<
C
ontent
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
)
{
public
List
<
C
ategory
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
)
{
return
this
.
contentDao
.
queryIdsByCategoryIdForParser
(
categoryId
,
BasicUtil
.
getAppId
(),
beginTime
,
endTime
,
null
,
null
);
return
this
.
contentDao
.
queryIdsByCategoryIdForParser
(
categoryId
,
BasicUtil
.
getAppId
(),
beginTime
,
endTime
,
null
,
null
);
}
}
@Override
@Override
public
List
<
C
ontent
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
)
{
public
List
<
C
ategory
Bean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
)
{
return
this
.
contentDao
.
queryIdsByCategoryIdForParser
(
categoryId
,
BasicUtil
.
getAppId
(),
beginTime
,
endTime
,
orderBy
,
order
);
return
this
.
contentDao
.
queryIdsByCategoryIdForParser
(
categoryId
,
BasicUtil
.
getAppId
(),
beginTime
,
endTime
,
orderBy
,
order
);
}
}
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.java
View file @
6fd16fbd
...
@@ -3,7 +3,7 @@ package net.mingsoft.cms.dao;
...
@@ -3,7 +3,7 @@ package net.mingsoft.cms.dao;
import
net.mingsoft.base.dao.IBaseDao
;
import
net.mingsoft.base.dao.IBaseDao
;
import
java.util.*
;
import
java.util.*
;
import
net.mingsoft.cms.bean.C
ontent
Bean
;
import
net.mingsoft.cms.bean.C
ategory
Bean
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
...
@@ -22,7 +22,7 @@ public interface IContentDao extends IBaseDao {
...
@@ -22,7 +22,7 @@ public interface IContentDao extends IBaseDao {
* @param endTime 结束时间
* @param endTime 结束时间
* @return
* @return
*/
*/
public
List
<
C
ontent
Bean
>
queryIdsByCategoryIdForParser
(
@Param
(
"categoryId"
)
String
categoryId
,
@Param
(
"appId"
)
int
appId
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"orderBy"
)
String
orderBy
,
@Param
(
"order"
)
String
order
);
public
List
<
C
ategory
Bean
>
queryIdsByCategoryIdForParser
(
@Param
(
"categoryId"
)
String
categoryId
,
@Param
(
"appId"
)
int
appId
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"orderBy"
)
String
orderBy
,
@Param
(
"order"
)
String
order
);
/**
/**
* 根据查询文章实体总数
* 根据查询文章实体总数
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
6fd16fbd
...
@@ -26,7 +26,32 @@
...
@@ -26,7 +26,32 @@
<result
column=
"del"
property=
"del"
/>
<!--删除标记 -->
<result
column=
"del"
property=
"del"
/>
<!--删除标记 -->
</resultMap>
</resultMap>
<resultMap
id=
"resultBean"
type=
"net.mingsoft.cms.bean.ContentBean"
>
<resultMap
id=
"resultContentMap"
type=
"net.mingsoft.cms.bean.ContentBean"
>
<id
column=
"id"
property=
"id"
/>
<!--编号 -->
<result
column=
"content_title"
property=
"contentTitle"
/>
<!--文章标题 -->
<result
column=
"content_category_id"
property=
"contentCategoryId"
/>
<!--所属栏目 -->
<result
column=
"content_type"
property=
"contentType"
/>
<!--文章类型 -->
<result
column=
"content_display"
property=
"contentDisplay"
/>
<!--是否显示 -->
<result
column=
"content_author"
property=
"contentAuthor"
/>
<!--文章作者 -->
<result
column=
"content_source"
property=
"contentSource"
/>
<!--文章来源 -->
<result
column=
"content_datetime"
property=
"contentDatetime"
/>
<!--发布时间 -->
<result
column=
"content_sort"
property=
"contentSort"
/>
<!--自定义顺序 -->
<result
column=
"content_img"
property=
"contentImg"
/>
<!--文章缩略图 -->
<result
column=
"content_description"
property=
"contentDescription"
/>
<!--描述 -->
<result
column=
"content_keyword"
property=
"contentKeyword"
/>
<!--关键字 -->
<result
column=
"content_details"
property=
"contentDetails"
/>
<!--文章内容 -->
<result
column=
"content_url"
property=
"contentUrl"
/>
<!--文章跳转链接地址 -->
<result
column=
"static_url"
property=
"staticUrl"
/>
<!--静态地址 -->
<result
column=
"content_hit"
property=
"contentHit"
/>
<!--点击次数 -->
<result
column=
"app_id"
property=
"appId"
/>
<!--文章管理的应用id -->
<result
column=
"create_by"
property=
"createBy"
/>
<!--创建人 -->
<result
column=
"create_date"
property=
"createDate"
/>
<!--创建时间 -->
<result
column=
"update_by"
property=
"updateBy"
/>
<!--修改人 -->
<result
column=
"update_date"
property=
"updateDate"
/>
<!--修改时间 -->
<result
column=
"del"
property=
"del"
/>
<!--删除标记 -->
</resultMap>
<resultMap
id=
"resultBean"
type=
"net.mingsoft.cms.bean.CategoryBean"
>
<id
column=
"id"
property=
"id"
/>
<!--编号 -->
<id
column=
"id"
property=
"id"
/>
<!--编号 -->
<id
column=
"article_Id"
property=
"articleId"
/>
<!--编号 -->
<id
column=
"article_Id"
property=
"articleId"
/>
<!--编号 -->
<result
column=
"category_title"
property=
"categoryTitle"
/>
<!--栏目管理名称 -->
<result
column=
"category_title"
property=
"categoryTitle"
/>
<!--栏目管理名称 -->
...
@@ -184,8 +209,9 @@
...
@@ -184,8 +209,9 @@
select * from cms_content order by id desc
select * from cms_content order by id desc
</select>
</select>
<!--条件查询-->
<!--条件查询-->
<select
id=
"query"
resultMap=
"resultMap"
>
<select
id=
"query"
resultMap=
"resultContentMap"
>
select ct.* from cms_content ct join cms_category cc on ct.content_category_id=cc.id
select ct.*,CONCAT("/html/",ct.app_id,cc.category_path,"/",ct.id,".html") AS static_url
from cms_content ct join cms_category cc on ct.content_category_id=cc.id
<where>
<where>
<if
test=
"contentTitle != null and contentTitle != ''"
>
and content_title like CONCAT('%',#{contentTitle},'%')
</if>
<if
test=
"contentTitle != null and contentTitle != ''"
>
and content_title like CONCAT('%',#{contentTitle},'%')
</if>
<if
test=
"contentCategoryId != null and contentCategoryId != ''"
>
and content_category_id=#{contentCategoryId}
</if>
<if
test=
"contentCategoryId != null and contentCategoryId != ''"
>
and content_category_id=#{contentCategoryId}
</if>
...
...
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
6fd16fbd
...
@@ -3,15 +3,13 @@ package net.mingsoft.cms.util;
...
@@ -3,15 +3,13 @@ package net.mingsoft.cms.util;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.PageUtil
;
import
cn.hutool.core.util.PageUtil
;
import
freemarker.cache.FileTemplateLoader
;
import
freemarker.core.ParseException
;
import
freemarker.core.ParseException
;
import
freemarker.template.MalformedTemplateNameException
;
import
freemarker.template.MalformedTemplateNameException
;
import
freemarker.template.Template
;
import
freemarker.template.TemplateNotFoundException
;
import
freemarker.template.TemplateNotFoundException
;
import
net.mingsoft.base.constant.Const
;
import
net.mingsoft.base.constant.Const
;
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.C
ontent
Bean
;
import
net.mingsoft.cms.bean.C
ategory
Bean
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.biz.IModelBiz
;
import
net.mingsoft.mdiy.biz.IModelBiz
;
...
@@ -151,7 +149,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -151,7 +149,7 @@ public class CmsParserUtil extends ParserUtil {
* @throws MalformedTemplateNameException
* @throws MalformedTemplateNameException
* @throws TemplateNotFoundException
* @throws TemplateNotFoundException
*/
*/
public
static
void
generateBasic
(
List
<
C
ontent
Bean
>
articleIdList
)
{
public
static
void
generateBasic
(
List
<
C
ategory
Bean
>
articleIdList
)
{
Map
<
Object
,
Object
>
contentModelMap
=
new
HashMap
<
Object
,
Object
>();
Map
<
Object
,
Object
>
contentModelMap
=
new
HashMap
<
Object
,
Object
>();
ModelEntity
contentModel
=
null
;
ModelEntity
contentModel
=
null
;
...
@@ -214,7 +212,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -214,7 +212,7 @@ public class CmsParserUtil extends ParserUtil {
parserParams
.
put
(
ID
,
articleId
);
parserParams
.
put
(
ID
,
articleId
);
// 第一篇文章没有上一篇
// 第一篇文章没有上一篇
if
(
artId
>
0
)
{
if
(
artId
>
0
)
{
C
ontent
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
C
ategory
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
preCaBean
.
getCategoryId
()+
""
)){
if
(
articleColumnPath
.
contains
(
preCaBean
.
getCategoryId
()+
""
)){
page
.
setPreId
(
preCaBean
.
getArticleId
());
page
.
setPreId
(
preCaBean
.
getArticleId
());
...
@@ -222,7 +220,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -222,7 +220,7 @@ public class CmsParserUtil extends ParserUtil {
}
}
// 最后一篇文章没有下一篇
// 最后一篇文章没有下一篇
if
(
artId
+
1
<
articleIdList
.
size
())
{
if
(
artId
+
1
<
articleIdList
.
size
())
{
C
ontent
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
C
ategory
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
nextCaBean
.
getCategoryId
()+
""
)){
if
(
articleColumnPath
.
contains
(
nextCaBean
.
getCategoryId
()+
""
)){
page
.
setNextId
(
nextCaBean
.
getArticleId
());
page
.
setNextId
(
nextCaBean
.
getArticleId
());
...
...
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