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
008c9d5b
Commit
008c9d5b
authored
Apr 19, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
0e99e11c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
194 additions
and
75 deletions
+194
-75
AuditServiceImpl.java
...energy/chnmuseum/party/service/impl/AuditServiceImpl.java
+57
-12
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+65
-14
ExhibitionBoardCatController.java
...um/party/web/controller/ExhibitionBoardCatController.java
+26
-15
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+32
-22
VideoContentCatController.java
...useum/party/web/controller/VideoContentCatController.java
+14
-12
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/AuditServiceImpl.java
View file @
008c9d5b
...
...
@@ -9,6 +9,7 @@ import cn.wisenergy.chnmuseum.party.model.*;
import
cn.wisenergy.chnmuseum.party.service.*
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -21,6 +22,8 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* <pre>
...
...
@@ -58,6 +61,12 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
@Resource
private
LearningContentCopyrightOwnerService
learningContentCopyrightOwnerService
;
@Resource
private
AuditService
auditService
;
@Resource
private
AssetService
assetService
;
@Override
public
Page
<
Audit
>
getUserList
(
Page
<
Audit
>
page
,
TUser
user
)
{
return
page
.
setRecords
(
auditMapper
.
getUserList
(
page
,
user
));
...
...
@@ -246,20 +255,43 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update
=
this
.
videoContentService
.
updateById
(
videoContent
);
break
;
case
REMOVE:
this
.
auditMapper
.
delete
(
Wrappers
.<
Audit
>
lambdaUpdate
().
eq
(
Audit:
:
getRefItemId
,
videoContentId
));
final
LambdaQueryWrapper
<
ExhibitionBoard
>
queryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getVideoContentId
,
videoContentId
);
queryWrapper
.
select
(
ExhibitionBoard:
:
getId
);
final
List
<
String
>
ExhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
queryWrapper
,
Object:
:
toString
);
this
.
exhibitionBoardService
.
removeByIds
(
ExhibitionBoardIdList
);
final
LambdaQueryWrapper
<
ExhibitionBoard
>
queryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getVideoContentId
,
videoContentId
).
select
(
ExhibitionBoard:
:
getId
);
final
List
<
String
>
exhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
queryWrapper
,
Object:
:
toString
);
if
(
exhibitionBoardIdList
!=
null
&&
!
exhibitionBoardIdList
.
isEmpty
())
{
this
.
exhibitionBoardService
.
removeByIds
(
exhibitionBoardIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
exhibitionBoardIdList
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
exhibitionBoardIdList
));
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
in
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
exhibitionBoardIdList
);
final
List
<
LearningContentBoard
>
learningContentBoardList
=
this
.
learningContentBoardService
.
list
(
learningContentBoardLambdaQueryWrapper
);
if
(
learningContentBoardList
!=
null
&&
!
learningContentBoardList
.
isEmpty
())
{
final
Map
<
String
,
List
<
String
>>
collect
=
learningContentBoardList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LearningContentBoard:
:
getLearningContentId
,
Collectors
.
mapping
(
LearningContentBoard:
:
getExhibitionBoardId
,
Collectors
.
toList
())));
collect
.
forEach
((
k
,
v
)
->
{
if
(
v
.
size
()
==
1
)
{
this
.
learningContentService
.
removeById
(
k
);
this
.
learningContentBoardService
.
remove
(
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
k
));
this
.
learningContentBoardCatService
.
remove
(
Wrappers
.<
LearningContentBoardCat
>
lambdaUpdate
().
eq
(
LearningContentBoardCat:
:
getLearningContentId
,
k
));
this
.
learningContentCopyrightOwnerService
.
remove
(
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
k
));
}
});
LambdaUpdateWrapper
<
LearningContentBoard
>
deleteWrapper1
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
in
(
LearningContentBoard:
:
getExhibitionBoardId
,
exhibitionBoardIdList
);
this
.
learningContentBoardService
.
remove
(
deleteWrapper1
);
}
}
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
videoContentId
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
videoContentId
));
update
=
this
.
videoContentService
.
removeById
(
videoContentId
);
break
;
case
ADD:
videoContent
.
setPublished
(
true
);
update
=
this
.
videoContentService
.
updateById
(
videoContent
);;
update
=
this
.
videoContentService
.
updateById
(
videoContent
);
;
break
;
case
EDIT:
videoContent
.
setPublished
(
true
);
update
=
this
.
videoContentService
.
updateById
(
videoContent
);;
update
=
this
.
videoContentService
.
updateById
(
videoContent
);
;
break
;
default
:
}
...
...
@@ -292,19 +324,32 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update
=
this
.
exhibitionBoardService
.
updateById
(
exhibitionBoard
);
break
;
case
REMOVE:
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
eq
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
exhibitionBoardId
);
final
List
<
LearningContentBoard
>
learningContentBoardList
=
this
.
learningContentBoardService
.
list
(
learningContentBoardLambdaQueryWrapper
);
if
(
learningContentBoardList
!=
null
&&
!
learningContentBoardList
.
isEmpty
())
{
final
Map
<
String
,
List
<
String
>>
collect
=
learningContentBoardList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LearningContentBoard:
:
getLearningContentId
,
Collectors
.
mapping
(
LearningContentBoard:
:
getExhibitionBoardId
,
Collectors
.
toList
())));
collect
.
forEach
((
k
,
v
)
->
{
if
(
v
.
size
()
==
1
)
{
this
.
learningContentService
.
removeById
(
k
);
this
.
learningContentBoardService
.
remove
(
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
k
));
this
.
learningContentBoardCatService
.
remove
(
Wrappers
.<
LearningContentBoardCat
>
lambdaUpdate
().
eq
(
LearningContentBoardCat:
:
getLearningContentId
,
k
));
this
.
learningContentCopyrightOwnerService
.
remove
(
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
k
));
}
});
LambdaUpdateWrapper
<
LearningContentBoard
>
learningContentBoardLambdaUpdateWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getExhibitionBoardId
,
exhibitionBoardId
);
this
.
learningContentBoardService
.
remove
(
learningContentBoardLambdaUpdateWrapper
);
}
this
.
auditMapper
.
delete
(
Wrappers
.<
Audit
>
lambdaUpdate
().
eq
(
Audit:
:
getRefItemId
,
exhibitionBoardId
));
this
.
learningContentBoardService
.
remove
(
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getExhibitionBoardId
,
exhibitionBoard
.
getId
()));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
eq
(
Asset:
:
getRefItemId
,
exhibitionBoardId
));
update
=
this
.
exhibitionBoardService
.
removeById
(
exhibitionBoardId
);
break
;
case
ADD:
exhibitionBoard
.
setPublished
(
true
);
update
=
this
.
exhibitionBoardService
.
updateById
(
exhibitionBoard
);
;
update
=
this
.
exhibitionBoardService
.
updateById
(
exhibitionBoard
);
break
;
case
EDIT:
exhibitionBoard
.
setPublished
(
true
);
update
=
this
.
exhibitionBoardService
.
updateById
(
exhibitionBoard
);
;
update
=
this
.
exhibitionBoardService
.
updateById
(
exhibitionBoard
);
break
;
default
:
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
008c9d5b
...
...
@@ -67,6 +67,10 @@ public class CopyrightOwnerController extends BaseController {
private
LearningContentBoardService
learningContentBoardService
;
@Resource
private
LearningContentBoardCatService
learningContentBoardCatService
;
@Resource
private
AuditService
auditService
;
@Resource
private
AssetService
assetService
;
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("copyright:owner:save")
...
...
@@ -287,25 +291,73 @@ public class CopyrightOwnerController extends BaseController {
public
Map
<
String
,
Object
>
deleteCopyrightOwner
(
@PathVariable
(
"id"
)
String
id
)
{
this
.
copyrightOwnerService
.
removeById
(
id
);
final
LambdaUpdateWrapper
<
VideoContent
>
updateWrapper
=
Wrappers
.<
VideoContent
>
lambdaUpdate
().
eq
(
VideoContent:
:
getVideoContentCopyrightOwnerId
,
id
);
updateWrapper
.
set
(
VideoContent:
:
getDeleted
,
true
);
this
.
videoContentService
.
update
(
updateWrapper
);
LambdaUpdateWrapper
<
CopyrightOwnerBoardCat
>
copyrightOwnerBoardCatLambdaUpdateWrapper
=
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerBoardCat:
:
getCopyrightOwnerId
,
id
);
this
.
copyrightOwnerBoardCatService
.
remove
(
copyrightOwnerBoardCatLambdaUpdateWrapper
);
LambdaUpdateWrapper
<
CopyrightOwnerVideoContentCat
>
copyrightOwnerVideoContentCatLambdaUpdateWrapper
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerVideoContentCat:
:
getCopyrightOwnerId
,
id
);
this
.
copyrightOwnerVideoContentCatService
.
remove
(
copyrightOwnerVideoContentCatLambdaUpdateWrapper
);
final
LambdaUpdateWrapper
<
ExhibitionBoard
>
updateWrapper1
=
Wrappers
.<
ExhibitionBoard
>
lambdaUpdate
().
eq
(
ExhibitionBoard:
:
getBoardCopyrightOwnerId
,
id
);
updateWrapper1
.
set
(
ExhibitionBoard:
:
getDeleted
,
true
);
this
.
exhibitionBoardService
.
update
(
updateWrapper1
);
final
LambdaQueryWrapper
<
VideoContent
>
videoContentLambdaQueryWrapper
=
Wrappers
.<
VideoContent
>
lambdaQuery
().
eq
(
VideoContent:
:
getVideoContentCopyrightOwnerId
,
id
).
select
(
VideoContent:
:
getId
);
final
List
<
String
>
videoContentIdList
=
this
.
videoContentService
.
listObjs
(
videoContentLambdaQueryWrapper
,
Object:
:
toString
);
if
(
videoContentIdList
!=
null
&&
!
videoContentIdList
.
isEmpty
())
{
this
.
videoContentService
.
removeByIds
(
videoContentIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
videoContentIdList
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
videoContentIdList
));
LambdaUpdateWrapper
<
CopyrightOwnerBoardCat
>
deleteWrapper
=
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerBoardCat:
:
getCopyrightOwnerId
,
id
);
this
.
copyrightOwnerBoardCatService
.
remove
(
deleteWrapper
);
final
LambdaQueryWrapper
<
ExhibitionBoard
>
exhibitionBoardLambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
in
(
ExhibitionBoard:
:
getVideoContentId
,
videoContentIdList
).
select
(
ExhibitionBoard:
:
getId
);
final
List
<
String
>
ExhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
exhibitionBoardLambdaQueryWrapper
,
Object:
:
toString
);
if
(
ExhibitionBoardIdList
!=
null
&&
!
ExhibitionBoardIdList
.
isEmpty
())
{
this
.
exhibitionBoardService
.
removeByIds
(
ExhibitionBoardIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
ExhibitionBoardIdList
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
ExhibitionBoardIdList
));
LambdaUpdateWrapper
<
CopyrightOwnerVideoContentCat
>
deleteWrapper1
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerVideoContentCat:
:
getCopyrightOwnerId
,
id
);
this
.
copyrightOwnerVideoContentCatService
.
remove
(
deleteWrapper1
);
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
in
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
ExhibitionBoardIdList
);
final
List
<
LearningContentBoard
>
learningContentBoardList
=
this
.
learningContentBoardService
.
list
(
learningContentBoardLambdaQueryWrapper
);
if
(
learningContentBoardList
!=
null
&&
!
learningContentBoardList
.
isEmpty
())
{
final
Map
<
String
,
List
<
String
>>
collect
=
learningContentBoardList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LearningContentBoard:
:
getLearningContentId
,
Collectors
.
mapping
(
LearningContentBoard:
:
getExhibitionBoardId
,
Collectors
.
toList
())));
collect
.
forEach
((
k
,
v
)
->
{
if
(
v
.
size
()
==
1
)
{
this
.
learningContentService
.
removeById
(
k
);
this
.
learningContentBoardService
.
remove
(
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
k
));
this
.
learningContentBoardCatService
.
remove
(
Wrappers
.<
LearningContentBoardCat
>
lambdaUpdate
().
eq
(
LearningContentBoardCat:
:
getLearningContentId
,
k
));
this
.
learningContentCopyrightOwnerService
.
remove
(
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
k
));
}
});
LambdaUpdateWrapper
<
LearningContentBoard
>
deleteWrapper1
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
in
(
LearningContentBoard:
:
getExhibitionBoardId
,
ExhibitionBoardIdList
);
this
.
learningContentBoardService
.
remove
(
deleteWrapper1
);
}
}
}
final
LambdaQueryWrapper
<
ExhibitionBoard
>
exhibitionBoardLambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getBoardCopyrightOwnerId
,
id
).
select
(
ExhibitionBoard:
:
getId
);
final
List
<
String
>
exhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
exhibitionBoardLambdaQueryWrapper
,
Object:
:
toString
);
if
(
exhibitionBoardIdList
!=
null
&&
!
exhibitionBoardIdList
.
isEmpty
())
{
this
.
exhibitionBoardService
.
removeByIds
(
exhibitionBoardIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
exhibitionBoardIdList
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
exhibitionBoardIdList
));
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
in
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
exhibitionBoardIdList
);
final
List
<
LearningContentBoard
>
learningContentBoardList
=
this
.
learningContentBoardService
.
list
(
learningContentBoardLambdaQueryWrapper
);
if
(
learningContentBoardList
!=
null
&&
!
learningContentBoardList
.
isEmpty
())
{
final
Map
<
String
,
List
<
String
>>
collect
=
learningContentBoardList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LearningContentBoard:
:
getLearningContentId
,
Collectors
.
mapping
(
LearningContentBoard:
:
getExhibitionBoardId
,
Collectors
.
toList
())));
collect
.
forEach
((
k
,
v
)
->
{
if
(
v
.
size
()
==
1
)
{
this
.
learningContentService
.
removeById
(
k
);
this
.
learningContentBoardService
.
remove
(
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
k
));
this
.
learningContentBoardCatService
.
remove
(
Wrappers
.<
LearningContentBoardCat
>
lambdaUpdate
().
eq
(
LearningContentBoardCat:
:
getLearningContentId
,
k
));
this
.
learningContentCopyrightOwnerService
.
remove
(
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
k
));
}
});
LambdaUpdateWrapper
<
LearningContentBoard
>
learningContentBoardLambdaUpdateWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
in
(
LearningContentBoard:
:
getExhibitionBoardId
,
exhibitionBoardIdList
);
this
.
learningContentBoardService
.
remove
(
learningContentBoardLambdaUpdateWrapper
);
}
}
final
LambdaQueryWrapper
<
LearningContentCopyrightOwner
>
learningContentCopyrightOwnerLambdaQueryWrapper
=
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaQuery
().
eq
(
LearningContentCopyrightOwner:
:
getCopyrightOwnerId
,
id
);
final
List
<
LearningContentCopyrightOwner
>
learningContentCopyrightOwnerList
=
this
.
learningContentCopyrightOwnerService
.
list
(
learningContentCopyrightOwnerLambdaQueryWrapper
);
if
(
learningContentCopyrightOwnerList
!=
null
&&
!
learningContentCopyrightOwnerList
.
isEmpty
())
{
final
Map
<
String
,
List
<
String
>>
collect
=
learningContentCopyrightOwnerList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
Collectors
.
mapping
(
LearningContentCopyrightOwner:
:
getCopyrightOwnerId
,
Collectors
.
toList
())));
collect
.
forEach
((
k
,
v
)
->
{
collect
.
forEach
((
k
,
v
)
->
{
if
(
v
.
size
()
==
1
)
{
this
.
learningContentService
.
removeById
(
k
);
this
.
learningContentBoardService
.
remove
(
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
k
));
...
...
@@ -313,9 +365,8 @@ public class CopyrightOwnerController extends BaseController {
this
.
learningContentCopyrightOwnerService
.
remove
(
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
k
));
}
});
LambdaUpdateWrapper
<
LearningContentCopyrightOwner
>
deleteWrapper2
=
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getCopyrightOwnerId
,
id
);
this
.
learningContentCopyrightOwnerService
.
remove
(
deleteWrapper2
);
LambdaUpdateWrapper
<
LearningContentCopyrightOwner
>
learningContentCopyrightOwnerLambdaUpdateWrapper
=
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getCopyrightOwnerId
,
id
);
this
.
learningContentCopyrightOwnerService
.
remove
(
learningContentCopyrightOwnerLambdaUpdateWrapper
);
}
return
getSuccessResult
();
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ExhibitionBoardCatController.java
View file @
008c9d5b
...
...
@@ -65,6 +65,8 @@ public class ExhibitionBoardCatController extends BaseController {
private
LearningContentCopyrightOwnerService
learningContentCopyrightOwnerService
;
@Resource
private
AuditService
auditService
;
@Resource
private
AssetService
assetService
;
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:cat:save")
...
...
@@ -204,21 +206,33 @@ public class ExhibitionBoardCatController extends BaseController {
public
Map
<
String
,
Object
>
deleteExhibitionBoardCat
(
@PathVariable
(
"id"
)
String
id
)
{
this
.
exhibitionBoardCatService
.
removeById
(
id
);
final
LambdaQueryWrapper
<
ExhibitionBoard
>
lambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getExhibitionBoardCatId
,
id
).
select
(
ExhibitionBoard:
:
getId
);
final
List
<
String
>
exhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
lambdaQueryWrapper
,
Object:
:
toString
);
LambdaUpdateWrapper
<
CopyrightOwnerBoardCat
>
copyrightOwnerBoardCatLambdaUpdateWrapper
=
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerBoardCat:
:
getBoardCatId
,
id
);
this
.
copyrightOwnerBoardCatService
.
remove
(
copyrightOwnerBoardCatLambdaUpdateWrapper
);
final
LambdaQueryWrapper
<
ExhibitionBoard
>
exhibitionBoardLambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getExhibitionBoardCatId
,
id
).
select
(
ExhibitionBoard:
:
getId
);
final
List
<
String
>
exhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
exhibitionBoardLambdaQueryWrapper
,
Object:
:
toString
);
if
(
exhibitionBoardIdList
!=
null
&&
!
exhibitionBoardIdList
.
isEmpty
())
{
final
LambdaUpdateWrapper
<
ExhibitionBoard
>
updateWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaUpdate
().
eq
(
ExhibitionBoard:
:
getExhibitionBoardCatId
,
id
);
updateWrapper
.
set
(
ExhibitionBoard:
:
getDeleted
,
true
);
this
.
exhibitionBoardService
.
update
(
updateWrapper
);
this
.
exhibitionBoardService
.
removeByIds
(
exhibitionBoardIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
exhibitionBoardIdList
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
exhibitionBoardIdList
));
LambdaUpdateWrapper
<
LearningContentBoard
>
deleteWrapper3
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
in
(
LearningContentBoard:
:
getExhibitionBoardId
,
exhibitionBoardIdList
);
this
.
learningContentBoardService
.
remove
(
deleteWrapper3
);
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
in
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
exhibitionBoardIdList
);
final
List
<
LearningContentBoard
>
learningContentBoardList
=
this
.
learningContentBoardService
.
list
(
learningContentBoardLambdaQueryWrapper
);
if
(
learningContentBoardList
!=
null
&&
!
learningContentBoardList
.
isEmpty
())
{
final
Map
<
String
,
List
<
String
>>
collect
=
learningContentBoardList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LearningContentBoard:
:
getLearningContentId
,
Collectors
.
mapping
(
LearningContentBoard:
:
getExhibitionBoardId
,
Collectors
.
toList
())));
collect
.
forEach
((
k
,
v
)
->
{
if
(
v
.
size
()
==
1
)
{
this
.
learningContentService
.
removeById
(
k
);
this
.
learningContentBoardService
.
remove
(
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getLearningContentId
,
k
));
this
.
learningContentBoardCatService
.
remove
(
Wrappers
.<
LearningContentBoardCat
>
lambdaUpdate
().
eq
(
LearningContentBoardCat:
:
getLearningContentId
,
k
));
this
.
learningContentCopyrightOwnerService
.
remove
(
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaUpdate
().
eq
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
k
));
}
});
LambdaUpdateWrapper
<
LearningContentBoard
>
learningContentBoardLambdaUpdateWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
in
(
LearningContentBoard:
:
getExhibitionBoardId
,
exhibitionBoardIdList
);
this
.
learningContentBoardService
.
remove
(
learningContentBoardLambdaUpdateWrapper
);
}
}
LambdaUpdateWrapper
<
CopyrightOwnerBoardCat
>
deleteWrapper
=
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerBoardCat:
:
getBoardCatId
,
id
);
this
.
copyrightOwnerBoardCatService
.
remove
(
deleteWrapper
);
final
LambdaQueryWrapper
<
LearningContentBoardCat
>
learningContentBoardCatLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoardCat
>
lambdaQuery
().
eq
(
LearningContentBoardCat:
:
getExhibitionBoardCatId
,
id
);
final
List
<
LearningContentBoardCat
>
learningContentBoardCatList
=
this
.
learningContentBoardCatService
.
list
(
learningContentBoardCatLambdaQueryWrapper
);
if
(
learningContentBoardCatList
!=
null
&&
!
learningContentBoardCatList
.
isEmpty
())
{
...
...
@@ -232,13 +246,10 @@ public class ExhibitionBoardCatController extends BaseController {
}
});
LambdaUpdateWrapper
<
LearningContentBoardCat
>
deleteWrapper1
=
Wrappers
.<
LearningContentBoardCat
>
lambdaUpdate
().
eq
(
LearningContentBoardCat:
:
getExhibitionBoardCatId
,
id
);
this
.
learningContentBoardCatService
.
remove
(
deleteWrapper1
);
LambdaUpdateWrapper
<
LearningContentBoardCat
>
learningContentBoardCatLambdaUpdateWrapper
=
Wrappers
.<
LearningContentBoardCat
>
lambdaUpdate
().
eq
(
LearningContentBoardCat:
:
getExhibitionBoardCatId
,
id
);
this
.
learningContentBoardCatService
.
remove
(
learningContentBoardCatLambdaUpdateWrapper
);
}
LambdaUpdateWrapper
<
LearningContentBoard
>
deleteWrapper2
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
eq
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
id
);
this
.
learningContentBoardService
.
remove
(
deleteWrapper2
);
// final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
// updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
008c9d5b
...
...
@@ -125,6 +125,7 @@ public class FileUploadController extends BaseController {
}
String
extName
=
FilenameUtils
.
getExtension
(
originalFilename
);
String
baseName
=
FilenameUtils
.
getBaseName
(
originalFilename
);
String
finalExtName
=
extName
;
boolean
anyMatch
=
Arrays
.
stream
(
DATUM_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
finalExtName
.
toUpperCase
()));
if
(
anyMatch
)
{
...
...
@@ -138,15 +139,39 @@ public class FileUploadController extends BaseController {
.
fileCat
(
FileCatEnum
.
EXHIBITION_BOARD_DATUM
.
name
())
.
build
();
String
fileUrl
=
null
;
String
language
=
null
;
final
Set
<
MetaData
>
metaDataSet
=
new
HashSet
<>();
metaDataSet
.
add
(
new
MetaData
(
"fileName"
,
originalFilename
));
if
(
originalFilename
.
contains
(
"汉语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
ZH
.
name
()));
language
=
LanguageEnum
.
ZH
.
name
();
}
else
if
(
originalFilename
.
contains
(
"英语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
EN
.
name
()));
language
=
LanguageEnum
.
EN
.
name
();
}
else
if
(
originalFilename
.
contains
(
"蒙语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
MN
.
name
()));
language
=
LanguageEnum
.
MN
.
name
();
}
else
if
(
originalFilename
.
contains
(
"藏语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
BO
.
name
()));
language
=
LanguageEnum
.
BO
.
name
();
}
else
if
(
originalFilename
.
contains
(
"维吾尔语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
UYG
.
name
()));
language
=
LanguageEnum
.
UYG
.
name
();
}
String
fileUrl
=
null
;
String
fileUrlCrypto
=
null
;
if
(
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
finalExtName
.
toUpperCase
())))
{
metaDataSet
.
add
(
new
MetaData
(
"fileType"
,
FileTypeEnum
.
VIDEO
.
name
()));
handleResult
.
setFileType
(
FileTypeEnum
.
VIDEO
.
name
());
asset
.
setFileType
(
FileTypeEnum
.
VIDEO
.
name
());
fileUrl
=
FastDFSUtils
.
uploadVideo
(
file
.
getInputStream
(),
file
.
getSize
(),
originalFilename
,
metaDataSet
);
final
Set
<
MetaData
>
fileMetaData
=
FastDFSUtils
.
getFileMetaData
(
fileUrl
);
final
ByteArrayOutputStream
byteArrayOutputStream
=
new
ByteArrayOutputStream
();
IOUtils
.
copy
(
file
.
getInputStream
(),
byteArrayOutputStream
);
fileUrl
=
FastDFSUtils
.
uploadVideo
(
new
ByteArrayInputStream
(
byteArrayOutputStream
.
toByteArray
()),
file
.
getSize
(),
originalFilename
,
metaDataSet
);
metaDataSet
.
add
(
new
MetaData
(
"fileName"
,
baseName
+
".chnmuseum"
));
fileUrlCrypto
=
FastDFSUtils
.
uploadVideo
(
VideoEncryptUtil
.
encrypt
(
new
ByteArrayInputStream
(
byteArrayOutputStream
.
toByteArray
()),
VideoEncryptUtil
.
cipher
),
file
.
getSize
(),
baseName
+
".chnmuseum"
,
metaDataSet
);
final
Set
<
MetaData
>
fileMetaData
=
FastDFSUtils
.
getFileMetaData
(
fileUrlCrypto
);
String
md5
=
fileMetaData
.
stream
().
filter
(
x
->
"MD5"
.
equals
(
x
.
getName
())).
map
(
MetaData:
:
getValue
).
findFirst
().
get
();
asset
.
setMd5
(
md5
);
}
else
if
(
Arrays
.
stream
(
AUDIO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
finalExtName
.
toUpperCase
())))
{
...
...
@@ -166,24 +191,6 @@ public class FileUploadController extends BaseController {
asset
.
setFileType
(
FileTypeEnum
.
DOCUMENT
.
name
());
fileUrl
=
FastDFSUtils
.
uploadFile
(
file
.
getInputStream
(),
file
.
getSize
(),
originalFilename
,
metaDataSet
);
}
String
language
=
null
;
if
(
originalFilename
.
contains
(
"汉语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
ZH
.
name
()));
language
=
LanguageEnum
.
ZH
.
name
();
}
else
if
(
originalFilename
.
contains
(
"英语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
EN
.
name
()));
language
=
LanguageEnum
.
EN
.
name
();
}
else
if
(
originalFilename
.
contains
(
"蒙语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
MN
.
name
()));
language
=
LanguageEnum
.
MN
.
name
();
}
else
if
(
originalFilename
.
contains
(
"藏语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
BO
.
name
()));
language
=
LanguageEnum
.
BO
.
name
();
}
else
if
(
originalFilename
.
contains
(
"维吾尔语"
))
{
metaDataSet
.
add
(
new
MetaData
(
"language"
,
LanguageEnum
.
UYG
.
name
()));
language
=
LanguageEnum
.
UYG
.
name
();
}
final
FileInfo
fileInfo
=
FastDFSUtils
.
getFileInfo
(
fileUrl
);
final
int
crc32
=
fileInfo
.
getCrc32
();
final
Asset
one
=
this
.
assetService
.
getOne
(
Wrappers
.<
Asset
>
lambdaQuery
().
eq
(
Asset:
:
getCrc32
,
(
long
)
crc32
).
last
(
" limit 1"
));
...
...
@@ -191,6 +198,7 @@ public class FileUploadController extends BaseController {
final
LocalDateTime
createTime
=
TimeUtils
.
getDateTimeOfTimestamp
(
fileInfo
.
getCreateTime
()
*
1000
);
asset
.
setFileSize
(
fileInfo
.
getFileSize
());
asset
.
setFileUrl
(
fileUrl
);
asset
.
setFileUrlCrypto
(
fileUrlCrypto
);
asset
.
setFileCat
(
FileCatEnum
.
EXHIBITION_BOARD_DATUM
.
name
());
asset
.
setLanguage
(
language
);
asset
.
setCrc32
((
long
)
crc32
);
...
...
@@ -198,7 +206,9 @@ public class FileUploadController extends BaseController {
asset
.
setUpdateTime
(
createTime
);
if
(
one
!=
null
)
{
FastDFSUtils
.
deleteFile
(
fileUrl
);
FastDFSUtils
.
deleteFile
(
fileUrlCrypto
);
asset
.
setFileUrl
(
one
.
getFileUrl
());
asset
.
setFileUrlCrypto
(
one
.
getFileUrlCrypto
());
}
this
.
assetService
.
save
(
asset
);
datumUrlList
.
add
(
asset
);
...
...
@@ -560,7 +570,7 @@ public class FileUploadController extends BaseController {
FastDFSUtils
.
deleteFile
(
fileUrl
);
FastDFSUtils
.
deleteFile
(
fileUrlCrypto
);
asset
.
setFileUrl
(
one
.
getFileUrl
());
asset
.
setFileUrlCrypto
(
one
.
getFileUrl
());
asset
.
setFileUrlCrypto
(
one
.
getFileUrl
Crypto
());
}
this
.
assetService
.
save
(
asset
);
fileList
.
add
(
asset
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/VideoContentCatController.java
View file @
008c9d5b
...
...
@@ -63,6 +63,8 @@ public class VideoContentCatController extends BaseController {
private
LearningContentService
learningContentService
;
@Resource
private
AuditService
auditService
;
@Resource
private
AssetService
assetService
;
@PostMapping
(
value
=
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("video:content:cat:save")
...
...
@@ -178,21 +180,24 @@ public class VideoContentCatController extends BaseController {
public
Map
<
String
,
Object
>
deleteVideoContentCat
(
@PathVariable
(
"id"
)
String
id
)
{
this
.
videoContentCatService
.
removeById
(
id
);
final
LambdaUpdateWrapper
<
CopyrightOwnerVideoContentCat
>
updateWrapper1
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
,
id
);
this
.
copyrightOwnerVideoContentCatService
.
remove
(
updateWrapper1
);
final
LambdaQueryWrapper
<
VideoContent
>
lambdaQueryWrapper
=
Wrappers
.<
VideoContent
>
lambdaQuery
().
eq
(
VideoContent:
:
getVideoContentCatId
,
id
).
select
(
VideoContent:
:
getId
);
final
List
<
String
>
videoContentIdList
=
this
.
videoContentService
.
listObjs
(
lambdaQueryWrapper
,
Object:
:
toString
);
if
(
videoContentIdList
!=
null
&&
!
videoContentIdList
.
isEmpty
())
{
final
LambdaUpdateWrapper
<
VideoContent
>
updateWrapper
=
Wrappers
.<
VideoContent
>
lambdaUpdate
().
eq
(
VideoContent:
:
getVideoContentCatId
,
id
);
updateWrapper
.
set
(
VideoContent:
:
getDeleted
,
true
);
this
.
videoContentService
.
update
(
updateWrapper
);
this
.
videoContentService
.
removeByIds
(
videoContentIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
videoContentIdList
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
videoContentIdList
));
final
LambdaQueryWrapper
<
ExhibitionBoard
>
queryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
in
(
ExhibitionBoard:
:
getVideoContentId
,
videoContentIdList
).
select
(
ExhibitionBoard:
:
getId
);
final
List
<
String
>
ExhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
queryWrapper
,
Object:
:
toString
);
if
(
ExhibitionBoardIdList
!=
null
&&
!
ExhibitionBoardIdList
.
isEmpty
())
{
this
.
exhibitionBoardService
.
removeByIds
(
ExhibitionBoardIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
ExhibitionBoardIdList
));
final
List
<
String
>
exhibitionBoardIdList
=
this
.
exhibitionBoardService
.
listObjs
(
queryWrapper
,
Object:
:
toString
);
if
(
exhibitionBoardIdList
!=
null
&&
!
exhibitionBoardIdList
.
isEmpty
())
{
this
.
exhibitionBoardService
.
removeByIds
(
exhibitionBoardIdList
);
this
.
auditService
.
remove
(
Wrappers
.<
Audit
>
lambdaUpdate
().
in
(
Audit:
:
getRefItemId
,
exhibitionBoardIdList
));
this
.
assetService
.
remove
(
Wrappers
.<
Asset
>
lambdaUpdate
().
in
(
Asset:
:
getRefItemId
,
exhibitionBoardIdList
));
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
in
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
E
xhibitionBoardIdList
);
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
in
(
LearningContentBoard:
:
getExhibitionBoardCatId
,
e
xhibitionBoardIdList
);
final
List
<
LearningContentBoard
>
learningContentBoardList
=
this
.
learningContentBoardService
.
list
(
learningContentBoardLambdaQueryWrapper
);
if
(
learningContentBoardList
!=
null
&&
!
learningContentBoardList
.
isEmpty
())
{
final
Map
<
String
,
List
<
String
>>
collect
=
learningContentBoardList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LearningContentBoard:
:
getLearningContentId
,
Collectors
.
mapping
(
LearningContentBoard:
:
getExhibitionBoardId
,
Collectors
.
toList
())));
...
...
@@ -205,15 +210,12 @@ public class VideoContentCatController extends BaseController {
}
});
LambdaUpdateWrapper
<
LearningContentBoard
>
deleteWrapper1
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
in
(
LearningContentBoard:
:
getExhibitionBoardId
,
E
xhibitionBoardIdList
);
LambdaUpdateWrapper
<
LearningContentBoard
>
deleteWrapper1
=
Wrappers
.<
LearningContentBoard
>
lambdaUpdate
().
in
(
LearningContentBoard:
:
getExhibitionBoardId
,
e
xhibitionBoardIdList
);
this
.
learningContentBoardService
.
remove
(
deleteWrapper1
);
}
}
}
final
LambdaUpdateWrapper
<
CopyrightOwnerVideoContentCat
>
updateWrapper1
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
,
id
);
this
.
copyrightOwnerVideoContentCatService
.
remove
(
updateWrapper1
);
// final LambdaQueryWrapper<CopyrightOwnerVideoContentCat> eq = Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
// final List<CopyrightOwnerVideoContentCat> list = this.copyrightOwnerVideoContentCatService.list(eq);
// final List<String> collect = list.stream().map(CopyrightOwnerVideoContentCat::getCopyrightOwnerId).distinct().collect(Collectors.toList());
...
...
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