Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
site-project
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
site-project
Commits
4a5f8fa3
Commit
4a5f8fa3
authored
Dec 17, 2024
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文章咨询三级分类
parent
8c7d0d35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
14 deletions
+49
-14
cloud-site-api/src/main/java/com/yizhi/site/application/vo/site/PublicationParamVO.java
+6
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
+31
-14
cloud-site-service/src/main/resources/mapper/PublicationMapper.xml
+12
-0
No files found.
cloud-site-api/src/main/java/com/yizhi/site/application/vo/site/PublicationParamVO.java
View file @
4a5f8fa3
...
...
@@ -19,6 +19,9 @@ public class PublicationParamVO extends ContextVO {
@ApiModelProperty
(
value
=
"标题"
)
private
String
fileName
;
@ApiModelProperty
(
value
=
"编号"
)
private
String
number
;
@ApiModelProperty
(
value
=
"当前页"
)
private
Integer
pageNo
;
...
...
@@ -28,6 +31,9 @@ public class PublicationParamVO extends ContextVO {
@ApiModelProperty
(
value
=
"类型"
)
private
Long
typeId
;
@ApiModelProperty
(
value
=
"类型级别"
)
private
Long
level
;
@ApiModelProperty
(
value
=
"发布时间的起点"
)
private
Date
start
;
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
View file @
4a5f8fa3
...
...
@@ -104,17 +104,22 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
Page
<
Publication
>
page
=
new
Page
<
Publication
>(
vo
.
getPageNo
(),
vo
.
getPageSize
());
List
<
Publication
>
list
=
null
;
DataClassification
selectById
=
dataClassificationService
.
selectById
(
vo
.
getTypeId
());
if
(
selectById
==
null
)
{
return
null
;
}
if
(
selectById
.
getName
().
equals
(
SiteConstant
.
ANNOUNCEMENT
)
&&
selectById
.
getParentId
()
==
0
)
{
//公告
list
=
publicationMapper
.
publicationFirstList
(
vo
,
page
);
}
else
if
(
selectById
.
getParentId
()
==
0
)
{
//新闻所有列表
list
=
publicationMapper
.
publicationFirstList
(
vo
,
page
);
}
else
{
list
=
publicationMapper
.
publicationFirstList
(
vo
,
page
);
//新闻分类列表
if
(
vo
.
getTypeId
()!=
null
)
{
DataClassification
selectById
=
dataClassificationService
.
selectById
(
vo
.
getTypeId
());
if
(
selectById
!=
null
)
{
if
(
selectById
.
getParentId
()
==
0
)
{
vo
.
setLevel
(
1L
);
}
else
{
selectById
=
dataClassificationService
.
selectById
(
selectById
.
getParentId
());
if
(
selectById
.
getParentId
()
==
0
)
{
vo
.
setLevel
(
2L
);
}
else
{
vo
.
setLevel
(
3L
);
}
}
}
}
list
=
publicationMapper
.
publicationFirstList
(
vo
,
page
);
//新闻分类列表
if
(
list
.
size
()
>
0
&&
list
!=
null
)
{
for
(
Publication
info
:
list
)
{
if
(
info
.
getTypeOne
()
!=
null
&&
info
.
getTypeOne
()
!=
0
)
{
...
...
@@ -421,15 +426,27 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
}
}
vo
.
setTypeId
(
typeOne
);
DataClassification
selectById
=
dataClassificationService
.
selectById
(
vo
.
getTypeId
());
if
(
selectById
==
null
)
{
return
null
;
}
//获取所有上架新闻列表
PublicationParamVO
publicationParamVO
=
new
PublicationParamVO
();
BeanUtils
.
copyProperties
(
vo
,
publicationParamVO
);
publicationParamVO
.
setState
(
4
);
Page
<
Publication
>
page
=
new
Page
<
Publication
>(
vo
.
getPageNo
(),
vo
.
getPageSize
());
if
(
vo
.
getTypeId
()!=
null
)
{
DataClassification
selectById
=
dataClassificationService
.
selectById
(
vo
.
getTypeId
());
if
(
selectById
!=
null
)
{
if
(
selectById
.
getParentId
()
==
0
)
{
publicationParamVO
.
setLevel
(
1L
);
}
else
{
selectById
=
dataClassificationService
.
selectById
(
selectById
.
getParentId
());
if
(
selectById
.
getParentId
()
==
0
)
{
publicationParamVO
.
setLevel
(
2L
);
}
else
{
publicationParamVO
.
setLevel
(
3L
);
}
}
}
}
List
<
Publication
>
list
=
publicationMapper
.
publicationFirstList
(
publicationParamVO
,
page
);
if
(
list
.
size
()
>
0
&&
list
!=
null
)
{
...
...
cloud-site-service/src/main/resources/mapper/PublicationMapper.xml
View file @
4a5f8fa3
...
...
@@ -52,6 +52,18 @@
<if
test=
"start != null"
>
and a.release_time >= #{start}
</if>
<if
test=
"number != null"
>
and a.number >= #{number}
</if>
<if
test=
"level == null or level == 1"
>
and a.type_one=#{typeId}
</if>
<if
test=
"level != null and level == 2"
>
and a.type_two=#{typeId}
</if>
<if
test=
"level != null and level == 3"
>
and a.type_three=#{typeId}
</if>
<if
test=
"end != null"
>
and #{end} >= a.release_time
</if>
...
...
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