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
43a36f38
Commit
43a36f38
authored
May 13, 2021
by
jiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改展板审核时,可以删除视频。
删除音频文件提交审核,报500错误
parent
b4b0c3d9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
AuditServiceImpl.java
...ava/cn/chnmuseum/party/service/impl/AuditServiceImpl.java
+5
-2
ExhibitionBoardController.java
...useum/party/web/controller/ExhibitionBoardController.java
+19
-0
No files found.
src/main/java/cn/chnmuseum/party/service/impl/AuditServiceImpl.java
View file @
43a36f38
...
...
@@ -23,6 +23,7 @@ import javax.annotation.Resource;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.function.Consumer
;
import
java.util.stream.Collectors
;
...
...
@@ -393,7 +394,8 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
assetQueryWrapper
.
eq
(
Asset:
:
getFileCat
,
FileCatEnum
.
EXHIBITION_BOARD_AUDIO
.
name
());
assetQueryWrapper
.
eq
(
Asset:
:
getPublished
,
true
);
final
List
<
Asset
>
assetList
=
this
.
assetMapper
.
selectList
(
assetQueryWrapper
);
final
Map
<
String
,
String
>
collect
=
assetList
.
stream
().
collect
(
Collectors
.
toMap
(
Asset:
:
getId
,
Asset:
:
getFileUrl
));
// final Map<String, String> collect = assetList.stream().collect(Collectors.toMap(Asset::getId, Asset::getFileUrl));
final
Set
<
String
>
collect
=
assetList
.
stream
().
map
(
Asset:
:
getId
).
collect
(
Collectors
.
toSet
());
for
(
String
audioId
:
audioIdList
)
{
final
Asset
asset
=
this
.
assetMapper
.
selectById
(
audioId
);
asset
.
setFileType
(
FileTypeEnum
.
AUDIO
.
name
());
...
...
@@ -406,7 +408,8 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
}
}
if
(!
collect
.
isEmpty
())
{
this
.
assetMapper
.
deleteBatchIds
(
collect
.
keySet
());
this
.
assetMapper
.
deleteBatchIds
(
collect
);
// this.assetMapper.deleteBatchIds(collect.keySet());
}
}
final
List
<
String
>
datumIdList
=
one
.
getDatumIdList
();
...
...
src/main/java/cn/chnmuseum/party/web/controller/ExhibitionBoardController.java
View file @
43a36f38
...
...
@@ -13,6 +13,7 @@ import cn.chnmuseum.party.service.*;
import
cn.chnmuseum.party.web.controller.base.BaseController
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
...
...
@@ -153,6 +154,9 @@ public class ExhibitionBoardController extends BaseController {
if
(
datumIdList
==
null
||
datumIdList
.
isEmpty
())
{
return
getFailResult
(
"400"
,
"参考资料文件必须上传"
);
}
//
removeNotInIds
(
audioIdList
,
exhibitionBoard
.
getId
());
for
(
String
audioId
:
audioIdList
)
{
final
Asset
asset
=
this
.
assetService
.
getById
(
audioId
);
if
(
asset
.
getPublished
())
{
...
...
@@ -162,6 +166,9 @@ public class ExhibitionBoardController extends BaseController {
this
.
assetService
.
updateById
(
asset
);
}
}
//
removeNotInIds
(
audioIdList
,
exhibitionBoard
.
getId
());
for
(
String
datumId
:
datumIdList
)
{
final
Asset
asset
=
this
.
assetService
.
getById
(
datumId
);
if
(
asset
.
getPublished
())
{
...
...
@@ -194,6 +201,18 @@ public class ExhibitionBoardController extends BaseController {
return
getSuccessResult
();
}
/**
* 修改展板时,不在这个id集合李淼的 代表是要删除的
*
* @param assetIds
*/
public
void
removeNotInIds
(
List
<
String
>
assetIds
,
String
refItemId
)
{
LambdaQueryWrapper
<
Asset
>
assetWrapper
=
new
QueryWrapper
<
Asset
>().
lambda
()
.
eq
(
Asset:
:
getRefItemId
,
refItemId
)
.
notIn
(
Asset:
:
getId
,
assetIds
);
boolean
remove
=
assetService
.
remove
(
assetWrapper
);
}
@PostMapping
(
"/getList"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:list")
@ApiOperation
(
value
=
"获取展板全部列表(无分页)"
,
notes
=
"获取展板全部列表(无分页)"
)
...
...
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