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
c8225e8d
Commit
c8225e8d
authored
Jan 21, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投稿发布
parent
0a4a8fab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
cloud-site-service/src/main/java/com/yizhi/site/application/service/InformationService.java
+2
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/InformationServiceImpl.java
+12
-3
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
+15
-0
No files found.
cloud-site-service/src/main/java/com/yizhi/site/application/service/InformationService.java
View file @
c8225e8d
...
...
@@ -30,6 +30,8 @@ public interface InformationService extends IService<Information> {
Long
insertInformation
(
Information
information
);
Long
insertInformation
(
Information
information
,
Long
id
);
/**
* 资讯发布(批量)
*/
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/InformationServiceImpl.java
View file @
c8225e8d
...
...
@@ -1075,7 +1075,14 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
@Override
public
Long
insertInformation
(
Information
information
)
{
Long
id
=
idGenerator
.
generate
();
return
insertInformation
(
information
,
null
);
}
@Override
public
Long
insertInformation
(
Information
information
,
Long
id
)
{
if
(
id
==
null
){
id
=
idGenerator
.
generate
();
}
information
.
setId
(
id
);
information
.
setIsTop
(
0L
);
// 判断时间
...
...
@@ -1167,8 +1174,10 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
Information
selectById
=
null
;
for
(
Long
id
:
ids
)
{
selectById
=
this
.
selectById
(
id
);
selectById
.
setState
(
1
);
list
.
add
(
selectById
);
if
(
selectById
!=
null
)
{
selectById
.
setState
(
1
);
list
.
add
(
selectById
);
}
}
if
(
list
.
size
()
>
0
)
{
this
.
updateBatchById
(
list
);
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
View file @
c8225e8d
...
...
@@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.site.application.constant.SiteConstant
;
import
com.yizhi.site.application.domain.DataClassification
;
import
com.yizhi.site.application.domain.Information
;
import
com.yizhi.site.application.domain.ProtalPlate
;
import
com.yizhi.site.application.domain.Publication
;
import
com.yizhi.site.application.mapper.*
;
...
...
@@ -51,6 +53,9 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
private
ProtalPlateService
protalPlateService
;
@Autowired
private
InformationService
informationService
;
@Autowired
private
InformationClassifyMapper
informationClassifyMapper
;
@Autowired
private
RedisTemplate
redisTemplate
;
...
...
@@ -150,12 +155,21 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
@Override
public
boolean
releases
(
ParamVO
vo
)
{
List
<
Long
>
ids
=
vo
.
getIds
();
RequestContext
res
=
ContextHolder
.
get
();
Long
siteId
=
res
.
getSiteId
();
List
<
Publication
>
list
=
new
ArrayList
<
Publication
>();
Publication
selectById
=
null
;
for
(
Long
id
:
ids
)
{
selectById
=
this
.
selectById
(
id
);
selectById
.
setState
(
SiteConstant
.
FOUR
);
selectById
.
setReleaseTime
(
new
Date
());
list
.
add
(
selectById
);
Information
informationViewVO
=
informationService
.
getInformation
(
id
,
siteId
);
if
(
informationViewVO
==
null
||
informationViewVO
.
getId
()==
null
)
{
Information
information
=
new
Information
();
BeanUtils
.
copyProperties
(
selectById
,
information
);
informationService
.
insertInformation
(
information
,
id
);
}
}
if
(
list
.
size
()
>
0
)
{
this
.
updateBatchById
(
list
);
...
...
@@ -184,6 +198,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
}
if
(
list
.
size
()
>
0
)
{
this
.
updateBatchById
(
list
);
informationService
.
unreleases
(
vo
);
}
return
true
;
}
...
...
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