Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
36271eb4
Commit
36271eb4
authored
Jun 04, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限制有对应展板的视频删除操作
parent
6b7782fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
ExhibitionBoardController.java
...useum/party/web/controller/ExhibitionBoardController.java
+24
-0
VideoContentController.java
...hnmuseum/party/web/controller/VideoContentController.java
+6
-0
No files found.
src/main/java/cn/chnmuseum/party/web/controller/ExhibitionBoardController.java
View file @
36271eb4
...
...
@@ -11,6 +11,7 @@ import cn.chnmuseum.party.common.vo.GenericPageParam;
import
cn.chnmuseum.party.model.*
;
import
cn.chnmuseum.party.service.*
;
import
cn.chnmuseum.party.web.controller.base.BaseController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -29,6 +30,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotBlank
;
import
java.time.LocalDateTime
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -61,6 +63,10 @@ public class ExhibitionBoardController extends BaseController {
private
AuditService
auditService
;
@Resource
private
AssetService
assetService
;
@Resource
private
LearningContentBoardService
learningContentBoardService
;
@Resource
private
LearningContentService
learningContentService
;
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:save")
...
...
@@ -487,6 +493,24 @@ public class ExhibitionBoardController extends BaseController {
@MethodLog
(
operModule
=
OperModule
.
DISPLAYCONTENT
,
operType
=
OperType
.
UPPER
)
public
Map
<
String
,
Object
>
enableExhibitionBoard
(
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"isPublish"
)
Boolean
isPublish
)
{
TUser
user
=
getcurUser
();
// 下架一个展板时,该展板对应的学习内容没下架不允许下架该展板
if
(!
isPublish
)
{
// 查询该展板对应的所有学习内容的id
LambdaQueryWrapper
<
LearningContentBoard
>
objectLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
objectLambdaQueryWrapper
.
eq
(
LearningContentBoard:
:
getExhibitionBoardId
,
id
);
List
<
LearningContentBoard
>
list
=
this
.
learningContentBoardService
.
list
(
objectLambdaQueryWrapper
);
List
<
String
>
collect
=
list
.
stream
().
map
(
LearningContentBoard:
:
getLearningContentId
).
collect
(
Collectors
.
toList
());
// 查询学习内容,判断是否已全部下架
LambdaQueryWrapper
<
LearningContent
>
learningContentLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
learningContentLambdaQueryWrapper
.
in
(
LearningContent:
:
getId
,
collect
);
List
<
LearningContent
>
list1
=
this
.
learningContentService
.
list
(
learningContentLambdaQueryWrapper
);
for
(
LearningContent
learningContent
:
list1
)
{
if
(
learningContent
.
getPublished
())
{
return
getFailResult
(
"该展板所在学习内容未下架,展板不能被下架!"
);
}
}
}
final
ExhibitionBoard
exhibitionBoard
=
this
.
exhibitionBoardService
.
getById
(
id
);
final
Audit
audit
=
Audit
.
builder
()
.
userId
(
user
.
getId
())
...
...
src/main/java/cn/chnmuseum/party/web/controller/VideoContentController.java
View file @
36271eb4
...
...
@@ -10,6 +10,7 @@ import cn.chnmuseum.party.common.vo.GenericPageParam;
import
cn.chnmuseum.party.model.*
;
import
cn.chnmuseum.party.service.*
;
import
cn.chnmuseum.party.web.controller.base.BaseController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -362,6 +363,11 @@ public class VideoContentController extends BaseController {
})
@MethodLog
(
operModule
=
OperModule
.
VIDEOCONTENT
,
operType
=
OperType
.
DELETE
)
public
Map
<
String
,
Object
>
deleteVideoContent
(
@PathVariable
(
"id"
)
String
id
)
{
// 视频关联展板时视频不能被删除
final
List
<
ExhibitionBoard
>
exhibitionBoardList
=
this
.
exhibitionBoardService
.
list
(
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getVideoContentId
,
id
));
if
(
CollectionUtil
.
isNotEmpty
(
exhibitionBoardList
))
{
return
getFailResult
(
"该视频有对应的展板信息,不能够被删除!"
);
}
final
VideoContent
videoContent
=
this
.
videoContentService
.
getById
(
id
);
final
Audit
audit
=
Audit
.
builder
()
.
content
(
videoContent
.
getName
())
...
...
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