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
7d9b2e91
Commit
7d9b2e91
authored
Apr 02, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
93db1527
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
132 additions
and
87 deletions
+132
-87
CopyrightOwnerTypeEnum.java
.../chnmuseum/party/common/enums/CopyrightOwnerTypeEnum.java
+2
-2
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+1
-1
CopyrightOwnerVideoContentCatMapper.java
...eum/party/mapper/CopyrightOwnerVideoContentCatMapper.java
+16
-0
CopyrightOwner.java
...va/cn/wisenergy/chnmuseum/party/model/CopyrightOwner.java
+7
-7
CopyrightOwnerVideoContentCat.java
.../chnmuseum/party/model/CopyrightOwnerVideoContentCat.java
+13
-10
CopyrightOwnerVideoContentCatService.java
...m/party/service/CopyrightOwnerVideoContentCatService.java
+16
-0
AuditServiceImpl.java
...energy/chnmuseum/party/service/impl/AuditServiceImpl.java
+1
-1
CopyrightOwnerVideoContentCatServiceImpl.java
...ervice/impl/CopyrightOwnerVideoContentCatServiceImpl.java
+22
-0
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+47
-59
CopyrightOwnerVideoContentCatMapper.xml
.../resources/mapper/CopyrightOwnerVideoContentCatMapper.xml
+7
-7
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/enums/CopyrightOwnerTypeEnum.java
View file @
7d9b2e91
...
...
@@ -8,8 +8,8 @@ import java.util.stream.Collectors;
*/
public
enum
CopyrightOwnerTypeEnum
{
ASSET
(
1
,
"视频
"
),
EXHIBITION_BOARD
(
2
,
"展板"
);
VIDEO_CONTENT
(
1
,
"视频内容
"
),
EXHIBITION_BOARD
(
2
,
"展板
内容
"
);
public
String
name
;
public
static
String
names
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
7d9b2e91
...
...
@@ -3,7 +3,7 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public
class
MysqlGenerator
{
private
static
final
String
[]
tableNames
=
new
String
[]{
"
asset"
,
"video_content"
,
"
video_content_cat"
"
copyright_owner_
video_content_cat"
};
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private
static
final
String
projectPath
=
"/opt/ss"
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/mapper/CopyrightOwner
AssetType
Mapper.java
→
src/main/java/cn/wisenergy/chnmuseum/party/mapper/CopyrightOwner
VideoContentCat
Mapper.java
View file @
7d9b2e91
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat
;
/**
* <pre>
...
...
@@ -10,9 +9,8 @@ import org.springframework.stereotype.Repository;
* </pre>
*
* @author Danny Lee
* @since 2021-0
3-18
* @since 2021-0
4-02
*/
@Repository
public
interface
CopyrightOwnerAssetTypeMapper
extends
BaseMapper
<
CopyrightOwnerAssetType
>
{
public
interface
CopyrightOwnerVideoContentCatMapper
extends
BaseMapper
<
CopyrightOwnerVideoContentCat
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/model/CopyrightOwner.java
View file @
7d9b2e91
...
...
@@ -45,7 +45,7 @@ public class CopyrightOwner implements Serializable {
@NotBlank
(
message
=
"版权方名称不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
name
;
@ApiModelProperty
(
value
=
"版权方类型"
,
allowableValues
=
"
ASSE
T, EXHIBITION_BOARD"
)
@ApiModelProperty
(
value
=
"版权方类型"
,
allowableValues
=
"
VIDEO_CONTEN
T, EXHIBITION_BOARD"
)
@TableField
(
"owner_type"
)
@NotBlank
(
message
=
"版权方类型不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
ownerType
;
...
...
@@ -72,16 +72,16 @@ public class CopyrightOwner implements Serializable {
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
"视频分类ID集合(详情使用)"
)
@ApiModelProperty
(
"视频
内容
分类ID集合(详情使用)"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
assetType
IdList
;
private
List
<
String
>
videoContentCat
IdList
;
@ApiModelProperty
(
"视频分类名称集合(详情使用)"
)
@ApiModelProperty
(
"视频
内容
分类名称集合(详情使用)"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
assetType
NameList
;
private
List
<
String
>
videoContentCat
NameList
;
@ApiModelProperty
(
"视频分类名称(列表使用)"
)
@ApiModelProperty
(
"视频
内容
分类名称(列表使用)"
)
@TableField
(
exist
=
false
)
private
String
assetType
Names
;
private
String
videoContentCat
Names
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/CopyrightOwner
AssetType
.java
→
src/main/java/cn/wisenergy/chnmuseum/party/model/CopyrightOwner
VideoContentCat
.java
View file @
7d9b2e91
...
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
* </p>
*
* @author Danny Lee
* @since 2021-0
3-23
* @since 2021-0
4-02
*/
@Data
@Builder
...
...
@@ -29,9 +29,9 @@ import java.io.Serializable;
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"copyright_owner_
asset_type
"
)
@TableName
(
"copyright_owner_
video_content_cat
"
)
@ApiModel
(
value
=
"版权方视频分类"
,
description
=
"版权方视频分类"
)
public
class
CopyrightOwner
AssetType
implements
Serializable
{
public
class
CopyrightOwner
VideoContentCat
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -40,14 +40,17 @@ public class CopyrightOwnerAssetType implements Serializable {
@NotNull
(
message
=
"标识ID不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
@ApiModelProperty
(
"视频版权方ID"
)
@ApiModelProperty
(
"视频
内容
版权方ID"
)
@TableField
(
"copyright_owner_id"
)
@NotBlank
(
message
=
"视频版权方ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
copyrightOwnerId
;
@NotBlank
(
message
=
"视频内容版权方ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
copyrightOwnerId
;
@ApiModelProperty
(
"视频内容分类ID"
)
@TableField
(
"video_content_cat_id"
)
@NotBlank
(
message
=
"视频内容分类ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
videoContentCatId
;
@ApiModelProperty
(
"视频分类ID"
)
@TableField
(
"asset_type_id"
)
@NotBlank
(
message
=
"视频分类ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
assetTypeId
;
}
src/main/java/cn/wisenergy/chnmuseum/party/service/CopyrightOwner
AssetType
Service.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/CopyrightOwner
VideoContentCat
Service.java
View file @
7d9b2e91
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
AssetType
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
VideoContentCat
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
...
...
@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* </p>
*
* @author Danny Lee
* @since 2021-0
3-18
* @since 2021-0
4-02
*/
public
interface
CopyrightOwner
AssetTypeService
extends
IService
<
CopyrightOwnerAssetType
>
{
public
interface
CopyrightOwner
VideoContentCatService
extends
IService
<
CopyrightOwnerVideoContentCat
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/AuditServiceImpl.java
View file @
7d9b2e91
...
...
@@ -103,7 +103,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
break
;
case
ACCOUNT:
break
;
case
ASSE
T:
case
VIDEO_CONTEN
T:
selectPage
=
auditMapper
.
getAssetPage
(
auditPage
,
ew
);
default
:
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/CopyrightOwner
AssetType
ServiceImpl.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/CopyrightOwner
VideoContentCat
ServiceImpl.java
View file @
7d9b2e91
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.mapper.CopyrightOwner
AssetType
Mapper
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
AssetType
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwner
AssetType
Service
;
import
cn.wisenergy.chnmuseum.party.mapper.CopyrightOwner
VideoContentCat
Mapper
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
VideoContentCat
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwner
VideoContentCat
Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -13,11 +13,10 @@ import org.springframework.stereotype.Service;
* </pre>
*
* @author Danny Lee
* @since 2021-0
3-18
* @since 2021-0
4-02
*/
@Slf4j
@Service
public
class
CopyrightOwnerAssetTypeServiceImpl
extends
ServiceImpl
<
CopyrightOwnerAssetTypeMapper
,
CopyrightOwnerAssetType
>
implements
CopyrightOwnerAssetTypeService
{
public
class
CopyrightOwnerVideoContentCatServiceImpl
extends
ServiceImpl
<
CopyrightOwnerVideoContentCatMapper
,
CopyrightOwnerVideoContentCat
>
implements
CopyrightOwnerVideoContentCatService
{
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
7d9b2e91
...
...
@@ -5,11 +5,14 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.VideoContentCat
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
AssetType
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
VideoContentCat
;
import
cn.wisenergy.chnmuseum.party.model.ExhibitionBoard
;
import
cn.wisenergy.chnmuseum.party.service.*
;
import
cn.wisenergy.chnmuseum.party.model.VideoContentCat
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerVideoContentCatService
;
import
cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService
;
import
cn.wisenergy.chnmuseum.party.service.VideoContentCatService
;
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
;
...
...
@@ -50,13 +53,10 @@ public class CopyrightOwnerController extends BaseController {
private
CopyrightOwnerService
copyrightOwnerService
;
@Resource
private
AssetService
assetService
;
@Resource
private
AssetTypeService
assetTypeService
;
private
VideoContentCatService
videoContentCatService
;
@Resource
private
CopyrightOwner
AssetTypeService
copyrightOwnerAssetType
Service
;
private
CopyrightOwner
VideoContentCatService
copyrightOwnerVideoContentCat
Service
;
@Resource
private
ExhibitionBoardService
exhibitionBoardService
;
...
...
@@ -64,23 +64,20 @@ public class CopyrightOwnerController extends BaseController {
@PostMapping
(
"/save"
)
@RequiresPermissions
(
"copyright:owner:save"
)
@ApiOperation
(
value
=
"添加版权方"
,
notes
=
"添加版权方"
)
public
Map
<
String
,
Object
>
saveCopyrightOwner
(
@Validated
(
value
=
{
Add
.
class
})
CopyrightOwner
copyrightOwner
//, @RequestParam("copyrightOwnerType") CopyrightOwnerTypeEnum copyrightOwnerTypeEnum
)
{
//copyrightOwner.setOwnerType(copyrightOwnerTypeEnum.name());
public
Map
<
String
,
Object
>
saveCopyrightOwner
(
@Validated
(
value
=
{
Add
.
class
})
CopyrightOwner
copyrightOwner
)
{
// 保存业务节点信息
boolean
result
=
copyrightOwnerService
.
save
(
copyrightOwner
);
List
<
String
>
assetTypeIdList
=
copyrightOwner
.
getAssetType
IdList
();
if
(
assetTypeIdList
!=
null
&&
!
assetType
IdList
.
isEmpty
())
{
List
<
CopyrightOwner
AssetType
>
copyrightOwnerAssetType
List
=
new
ArrayList
<>();
for
(
String
assetTypeId
:
assetType
IdList
)
{
copyrightOwner
AssetTypeList
.
add
(
CopyrightOwnerAssetType
.
builder
()
.
assetTypeId
(
assetType
Id
)
final
List
<
String
>
videoContentCatIdList
=
copyrightOwner
.
getVideoContentCat
IdList
();
if
(
videoContentCatIdList
!=
null
&&
!
videoContentCat
IdList
.
isEmpty
())
{
List
<
CopyrightOwner
VideoContentCat
>
copyrightOwnerVideoContentCat
List
=
new
ArrayList
<>();
for
(
String
videoContentCatId
:
videoContentCat
IdList
)
{
copyrightOwner
VideoContentCatList
.
add
(
CopyrightOwnerVideoContentCat
.
builder
()
.
videoContentCatId
(
videoContentCat
Id
)
.
copyrightOwnerId
(
copyrightOwner
.
getId
())
.
build
());
}
this
.
copyrightOwner
AssetTypeService
.
saveBatch
(
copyrightOwnerAssetType
List
);
this
.
copyrightOwner
VideoContentCatService
.
saveBatch
(
copyrightOwnerVideoContentCat
List
);
}
// 返回操作结果
...
...
@@ -98,19 +95,19 @@ public class CopyrightOwnerController extends BaseController {
public
Map
<
String
,
Object
>
updateCopyrightOwner
(
@Validated
(
value
=
{
Update
.
class
})
CopyrightOwner
copyrightOwner
)
{
boolean
flag
=
copyrightOwnerService
.
updateById
(
copyrightOwner
);
List
<
String
>
assetTypeIdList
=
copyrightOwner
.
getAssetType
IdList
();
if
(
assetTypeIdList
!=
null
&&
!
assetType
IdList
.
isEmpty
())
{
LambdaUpdateWrapper
<
CopyrightOwner
AssetType
>
updateWrapper
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaUpdate
().
eq
(
CopyrightOwnerAssetType
:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
());
this
.
copyrightOwner
AssetType
Service
.
remove
(
updateWrapper
);
final
List
<
String
>
videoContentCatIdList
=
copyrightOwner
.
getVideoContentCat
IdList
();
if
(
videoContentCatIdList
!=
null
&&
!
videoContentCat
IdList
.
isEmpty
())
{
LambdaUpdateWrapper
<
CopyrightOwner
VideoContentCat
>
updateWrapper
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerVideoContentCat
:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
());
this
.
copyrightOwner
VideoContentCat
Service
.
remove
(
updateWrapper
);
List
<
CopyrightOwner
AssetType
>
copyrightOwnerAssetType
List
=
new
ArrayList
<>();
for
(
String
assetTypeId
:
assetType
IdList
)
{
copyrightOwner
AssetTypeList
.
add
(
CopyrightOwnerAssetType
.
builder
()
.
assetTypeId
(
assetType
Id
)
List
<
CopyrightOwner
VideoContentCat
>
copyrightOwnerVideoContentCat
List
=
new
ArrayList
<>();
for
(
String
videoContentCatId
:
videoContentCat
IdList
)
{
copyrightOwner
VideoContentCatList
.
add
(
CopyrightOwnerVideoContentCat
.
builder
()
.
videoContentCatId
(
videoContentCat
Id
)
.
copyrightOwnerId
(
copyrightOwner
.
getId
())
.
build
());
}
this
.
copyrightOwner
AssetTypeService
.
saveBatch
(
copyrightOwnerAssetType
List
);
this
.
copyrightOwner
VideoContentCatService
.
saveBatch
(
copyrightOwnerVideoContentCat
List
);
}
if
(
flag
)
{
return
getSuccessResult
();
...
...
@@ -118,16 +115,6 @@ public class CopyrightOwnerController extends BaseController {
return
getFailResult
();
}
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"copyright:owner:delete"
)
@ApiOperation
(
value
=
"根据ID删除版权方"
,
notes
=
"根据ID删除版权方"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
deleteCopyrightOwner
(
@PathVariable
(
"id"
)
String
id
)
{
return
getSuccessResult
();
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"copyrightOwnerType"
,
value
=
"版权方类型"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
)
})
...
...
@@ -145,7 +132,7 @@ public class CopyrightOwnerController extends BaseController {
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"ownerType"
,
value
=
"版权方类型"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
allowableValues
=
"
ASSE
T, EXHIBITION_BOARD"
),
@ApiImplicitParam
(
name
=
"ownerType"
,
value
=
"版权方类型"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
allowableValues
=
"
VIDEO_CONTEN
T, EXHIBITION_BOARD"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
...
...
@@ -171,6 +158,7 @@ public class CopyrightOwnerController extends BaseController {
queryWrapper
.
select
(
CopyrightOwner:
:
getId
,
CopyrightOwner:
:
getName
,
CopyrightOwner:
:
getOwnerType
,
CopyrightOwner:
:
getExpireDateStart
,
CopyrightOwner:
:
getExpireDateEnd
,
CopyrightOwner:
:
getRemarks
,
...
...
@@ -178,22 +166,22 @@ public class CopyrightOwnerController extends BaseController {
CopyrightOwner:
:
getUpdateTime
);
Page
<
CopyrightOwner
>
page
=
this
.
copyrightOwnerService
.
page
(
getPage
(),
queryWrapper
);
for
(
CopyrightOwner
copyrightOwner
:
page
.
getRecords
())
{
if
(
CopyrightOwnerTypeEnum
.
ASSE
T
.
name
().
equals
(
genericPageParam
.
getOwnerType
()))
{
List
<
CopyrightOwner
AssetType
>
CopyrightOwnerAssetTypeList
=
this
.
copyrightOwnerAssetTypeService
.
list
(
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaQuery
().
eq
(
CopyrightOwnerAssetType
:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
()));
if
(!
CopyrightOwnerAssetType
List
.
isEmpty
())
{
Set
<
String
>
idList
=
CopyrightOwnerAssetTypeList
.
stream
().
map
(
CopyrightOwnerAssetType:
:
getAssetType
Id
).
collect
(
Collectors
.
toSet
());
List
<
VideoContentCat
>
videoContentCatList
=
this
.
assetType
Service
.
listByIds
(
idList
);
String
assetTypeNameList
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
set
AssetTypeNames
(
assetTypeNameList
);
if
(
CopyrightOwnerTypeEnum
.
VIDEO_CONTEN
T
.
name
().
equals
(
genericPageParam
.
getOwnerType
()))
{
List
<
CopyrightOwner
VideoContentCat
>
copyrightOwnerVideoContentCatList
=
this
.
copyrightOwnerVideoContentCatService
.
list
(
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaQuery
().
eq
(
CopyrightOwnerVideoContentCat
:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
()));
if
(!
copyrightOwnerVideoContentCat
List
.
isEmpty
())
{
Set
<
String
>
idList
=
copyrightOwnerVideoContentCatList
.
stream
().
map
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCat
Id
).
collect
(
Collectors
.
toSet
());
List
<
VideoContentCat
>
videoContentCatList
=
this
.
videoContentCat
Service
.
listByIds
(
idList
);
String
videoContentCatNames
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
set
VideoContentCatNames
(
videoContentCatNames
);
}
}
else
if
(
CopyrightOwnerTypeEnum
.
EXHIBITION_BOARD
.
name
().
equals
(
genericPageParam
.
getOwnerType
()))
{
LambdaQueryWrapper
<
ExhibitionBoard
>
lambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getBoardCopyrightOwnerId
,
copyrightOwner
.
getId
());
List
<
ExhibitionBoard
>
exhibitionBoardList
=
this
.
exhibitionBoardService
.
list
(
lambdaQueryWrapper
);
if
(!
exhibitionBoardList
.
isEmpty
())
{
Set
<
String
>
assetTypeIdList
=
exhibitionBoardList
.
stream
().
map
(
ExhibitionBoard:
:
getAssetType
Id
).
collect
(
Collectors
.
toSet
());
List
<
VideoContentCat
>
videoContentCatList
=
this
.
assetTypeService
.
listByIds
(
assetType
IdList
);
String
assetType
Names
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
set
AssetTypeNames
(
assetType
Names
);
Set
<
String
>
videoContentCatIdList
=
exhibitionBoardList
.
stream
().
map
(
ExhibitionBoard:
:
getVideoContentCat
Id
).
collect
(
Collectors
.
toSet
());
List
<
VideoContentCat
>
videoContentCatList
=
this
.
videoContentCatService
.
listByIds
(
videoContentCat
IdList
);
String
videoContentCat
Names
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
set
VideoContentCatNames
(
videoContentCat
Names
);
}
}
}
...
...
@@ -209,16 +197,16 @@ public class CopyrightOwnerController extends BaseController {
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
CopyrightOwner
copyrightOwner
=
copyrightOwnerService
.
getById
(
id
);
String
ownerType
=
copyrightOwner
.
getOwnerType
();
if
(
CopyrightOwnerTypeEnum
.
ASSE
T
.
name
().
equals
(
ownerType
))
{
LambdaQueryWrapper
<
CopyrightOwner
AssetType
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaQuery
().
eq
(
CopyrightOwnerAssetType
:
:
getCopyrightOwnerId
,
id
);
List
<
CopyrightOwnerAssetType
>
copyrightOwnerAssetTypeList
=
this
.
copyrightOwnerAssetType
Service
.
list
(
lambdaQueryWrapper
);
if
(!
copyrightOwner
AssetType
List
.
isEmpty
())
{
List
<
String
>
assetTypeIdArrayList
=
copyrightOwnerAssetTypeList
.
stream
().
map
(
CopyrightOwnerAssetType:
:
getAssetType
Id
).
distinct
().
collect
(
Collectors
.
toList
());
copyrightOwner
.
set
AssetTypeIdList
(
assetTypeIdArray
List
);
final
List
<
VideoContentCat
>
videoContentCatList
=
this
.
assetTypeService
.
listByIds
(
assetTypeIdArray
List
);
if
(
CopyrightOwnerTypeEnum
.
VIDEO_CONTEN
T
.
name
().
equals
(
ownerType
))
{
LambdaQueryWrapper
<
CopyrightOwner
VideoContentCat
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaQuery
().
eq
(
CopyrightOwnerVideoContentCat
:
:
getCopyrightOwnerId
,
id
);
final
List
<
CopyrightOwnerVideoContentCat
>
copyrightOwnerVideoContentCatList
=
this
.
copyrightOwnerVideoContentCat
Service
.
list
(
lambdaQueryWrapper
);
if
(!
copyrightOwner
VideoContentCat
List
.
isEmpty
())
{
List
<
String
>
videoContentCatIdList
=
copyrightOwnerVideoContentCatList
.
stream
().
map
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCat
Id
).
distinct
().
collect
(
Collectors
.
toList
());
copyrightOwner
.
set
VideoContentCatIdList
(
videoContentCatId
List
);
final
List
<
VideoContentCat
>
videoContentCatList
=
this
.
videoContentCatService
.
listByIds
(
videoContentCatId
List
);
if
(!
videoContentCatList
.
isEmpty
())
{
final
List
<
String
>
assetType
NameList
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
toList
());
copyrightOwner
.
set
AssetTypeNameList
(
assetType
NameList
);
final
List
<
String
>
videoContentCat
NameList
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
toList
());
copyrightOwner
.
set
VideoContentCatNameList
(
videoContentCat
NameList
);
}
}
}
...
...
src/main/resources/mapper/CopyrightOwner
AssetType
Mapper.xml
→
src/main/resources/mapper/CopyrightOwner
VideoContentCat
Mapper.xml
View file @
7d9b2e91
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.CopyrightOwner
AssetType
Mapper"
>
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.CopyrightOwner
VideoContentCat
Mapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.CopyrightOwner
AssetType
"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"asset_type_id"
property=
"assetTypeId"
/>
</resultMap>
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.CopyrightOwner
VideoContentCat
"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"video_content_cat_id"
property=
"videoContentCatId"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, copyright_owner_id,
asset_type
_id
id, copyright_owner_id,
video_content_cat
_id
</sql>
</mapper>
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