Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
9311c247
Commit
9311c247
authored
Apr 16, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
088b5daa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
30 deletions
+25
-30
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+12
-1
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+3
-13
VideoContentCatController.java
...useum/party/web/controller/VideoContentCatController.java
+10
-16
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
9311c247
...
...
@@ -71,7 +71,12 @@ public class CopyrightOwnerController extends BaseController {
@ApiOperation
(
value
=
"添加版权方"
,
notes
=
"添加版权方"
)
@MethodLog
(
operModule
=
OperModule
.
DISPLAYCOPYRIGHT
,
operType
=
OperType
.
ADD
)
public
Map
<
String
,
Object
>
saveCopyrightOwner
(
@Validated
(
value
=
{
Add
.
class
})
CopyrightOwner
copyrightOwner
)
{
// 保存业务节点信息
final
LambdaQueryWrapper
<
CopyrightOwner
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwner
>
lambdaQuery
().
eq
(
CopyrightOwner:
:
getName
,
copyrightOwner
.
getName
().
trim
());
lambdaQueryWrapper
.
eq
(
CopyrightOwner:
:
getOwnerType
,
copyrightOwner
.
getOwnerType
().
trim
());
final
int
count
=
this
.
copyrightOwnerService
.
count
(
lambdaQueryWrapper
);
if
(
count
>
0
)
{
return
getFailResult
(
"400"
,
"名称已存在,请修改名称"
);
}
boolean
result
=
copyrightOwnerService
.
save
(
copyrightOwner
);
final
List
<
String
>
videoContentCatIdList
=
copyrightOwner
.
getVideoContentCatIdList
();
...
...
@@ -112,6 +117,12 @@ public class CopyrightOwnerController extends BaseController {
@ApiOperation
(
value
=
"修改版权方信息"
,
notes
=
"修改版权方信息"
)
@MethodLog
(
operModule
=
OperModule
.
DISPLAYCOPYRIGHT
,
operType
=
OperType
.
UPDATE
)
public
Map
<
String
,
Object
>
updateCopyrightOwner
(
@Validated
(
value
=
{
Update
.
class
})
CopyrightOwner
copyrightOwner
)
{
final
LambdaQueryWrapper
<
CopyrightOwner
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwner
>
lambdaQuery
().
eq
(
CopyrightOwner:
:
getName
,
copyrightOwner
.
getName
().
trim
());
lambdaQueryWrapper
.
eq
(
CopyrightOwner:
:
getOwnerType
,
copyrightOwner
.
getOwnerType
().
trim
());
final
int
count
=
this
.
copyrightOwnerService
.
count
(
lambdaQueryWrapper
);
if
(
count
>
0
)
{
return
getFailResult
(
"400"
,
"名称已存在,请修改名称"
);
}
boolean
flag
=
copyrightOwnerService
.
updateById
(
copyrightOwner
);
final
List
<
String
>
videoContentCatIdList
=
copyrightOwner
.
getVideoContentCatIdList
();
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
9311c247
...
...
@@ -645,30 +645,20 @@ public class FileUploadController extends BaseController {
extName
=
"mp4"
;
originalFilename
=
FilenameUtils
.
getBaseName
(
originalFilename
)
+
"."
+
extName
;
}
String
language
=
null
;
final
Set
<
MetaData
>
metaDataSet
=
new
HashSet
<>();
metaDataSet
.
add
(
new
MetaData
(
"fileName"
,
originalFilename
));
metaDataSet
.
add
(
new
MetaData
(
"fileType"
,
FileTypeEnum
.
VIDEO
.
name
()));
String
fileUrl
=
FastDFSUtils
.
uploadFile
(
file
.
getInputStream
(),
file
.
getSize
(),
originalFilename
,
metaDataSet
);
final
String
fileUrl
=
FastDFSUtils
.
uploadFile
(
file
.
getInputStream
(),
file
.
getSize
(),
originalFilename
,
metaDataSet
);
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"));
final
long
fileSize
=
fileInfo
.
getFileSize
();
final
Asset
asset
=
Asset
.
builder
()
.
fileName
(
originalFilename
)
.
fileExtName
(
extName
)
.
fileType
(
FileTypeEnum
.
VIDEO
.
name
())
.
fileSize
(
file
Size
)
.
fileSize
(
file
Info
.
getFileSize
()
)
.
fileUrl
(
fileUrl
)
.
fileCat
(
FileCatEnum
.
VIEWING_INTERACTION
.
name
())
.
language
(
language
)
.
crc32
((
long
)
crc32
)
.
crc32
((
long
)
fileInfo
.
getCrc32
())
.
build
();
// if (one != null) {
// FastDFSUtils.deleteFile(fileUrl);
// asset.setFileUrl(one.getFileUrl());
// }
this
.
assetService
.
save
(
asset
);
fileList
.
add
(
asset
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/VideoContentCatController.java
View file @
9311c247
...
...
@@ -9,7 +9,10 @@ import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat
;
import
cn.wisenergy.chnmuseum.party.model.VideoContent
;
import
cn.wisenergy.chnmuseum.party.model.VideoContentCat
;
import
cn.wisenergy.chnmuseum.party.service.*
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerVideoContentCatService
;
import
cn.wisenergy.chnmuseum.party.service.VideoContentCatService
;
import
cn.wisenergy.chnmuseum.party.service.VideoContentService
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
...
@@ -27,9 +30,9 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
java.util.Collections
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -58,12 +61,6 @@ public class VideoContentCatController extends BaseController {
@Resource
private
CopyrightOwnerService
copyrightOwnerService
;
@Resource
private
ExhibitionBoardService
exhibitionBoardService
;
@Resource
private
CopyrightOwnerBoardCatService
copyrightOwnerBoardCatService
;
@PostMapping
(
value
=
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("video:content:cat:save")
@ApiOperation
(
value
=
"添加视频内容分类"
,
notes
=
"添加视频内容分类"
)
...
...
@@ -146,14 +143,11 @@ public class VideoContentCatController extends BaseController {
VideoContentCat:
:
getUpdateTime
);
Page
<
VideoContentCat
>
page
=
this
.
videoContentCatService
.
page
(
getPage
(),
queryWrapper
);
for
(
VideoContentCat
videoContentCat
:
page
.
getRecords
())
{
LambdaQueryWrapper
<
VideoContent
>
lambdaQueryWrapper
=
Wrappers
.<
VideoContent
>
lambdaQuery
().
eq
(
VideoContent:
:
getVideoContentCatId
,
videoContentCat
.
getId
());
lambdaQueryWrapper
=
lambdaQueryWrapper
.
select
(
VideoContent:
:
getId
).
select
(
VideoContent:
:
getVideoContentCopyrightOwnerId
);
List
<
VideoContent
>
videoContentList
=
this
.
videoContentService
.
list
(
lambdaQueryWrapper
);
if
(!
videoContentList
.
isEmpty
())
{
final
Set
<
String
>
videoContentCopyrightOwnerIdList
=
videoContentList
.
stream
().
map
(
VideoContent:
:
getVideoContentCopyrightOwnerId
).
collect
(
Collectors
.
toSet
());
List
<
CopyrightOwner
>
copyrightOwnerList
=
this
.
copyrightOwnerService
.
listByIds
(
videoContentCopyrightOwnerIdList
);
String
copyrightOwnerName
=
copyrightOwnerList
.
stream
().
map
(
CopyrightOwner:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
videoContentCat
.
setCopyrightOwnerName
(
copyrightOwnerName
);
LambdaQueryWrapper
<
VideoContent
>
lambdaQueryWrapper
=
Wrappers
.<
VideoContent
>
lambdaQuery
().
eq
(
VideoContent:
:
getVideoContentCatId
,
videoContentCat
.
getId
()).
select
(
VideoContent:
:
getVideoContentCopyrightOwnerId
);
final
List
<
String
>
videoContentCopyrightOwnerIdList
=
this
.
videoContentService
.
listObjs
(
lambdaQueryWrapper
,
Object:
:
toString
);
if
(!
videoContentCopyrightOwnerIdList
.
isEmpty
())
{
List
<
CopyrightOwner
>
copyrightOwnerList
=
this
.
copyrightOwnerService
.
listByIds
(
new
LinkedHashSet
<>(
videoContentCopyrightOwnerIdList
));
videoContentCat
.
setCopyrightOwnerName
(
copyrightOwnerList
.
stream
().
map
(
CopyrightOwner:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
)));
}
}
return
getResult
(
page
);
...
...
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