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
0a8d9a38
Commit
0a8d9a38
authored
Apr 12, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
346e6661
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
172 additions
and
35 deletions
+172
-35
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+1
-1
CopyrightOwnerBoardCatMapper.java
.../chnmuseum/party/mapper/CopyrightOwnerBoardCatMapper.java
+16
-0
CopyrightOwner.java
...va/cn/wisenergy/chnmuseum/party/model/CopyrightOwner.java
+12
-0
CopyrightOwnerBoardCat.java
...senergy/chnmuseum/party/model/CopyrightOwnerBoardCat.java
+6
-6
CopyrightOwnerBoardCatService.java
...hnmuseum/party/service/CopyrightOwnerBoardCatService.java
+3
-3
CopyrightOwnerBoardCatServiceImpl.java
...party/service/impl/CopyrightOwnerBoardCatServiceImpl.java
+28
-0
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+58
-14
ExhibitionBoardCatController.java
...um/party/web/controller/ExhibitionBoardCatController.java
+20
-2
VideoContentCatController.java
...useum/party/web/controller/VideoContentCatController.java
+21
-2
CopyrightOwnerBoardCatMapper.xml
src/main/resources/mapper/CopyrightOwnerBoardCatMapper.xml
+7
-7
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
0a8d9a38
...
...
@@ -3,7 +3,7 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public
class
MysqlGenerator
{
private
static
final
String
[]
tableNames
=
new
String
[]{
"
asse
t"
"
copyright_owner_board_ca
t"
};
// 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/CopyrightOwnerBoard
Type
Mapper.java
→
src/main/java/cn/wisenergy/chnmuseum/party/mapper/CopyrightOwnerBoard
Cat
Mapper.java
View file @
0a8d9a38
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardType
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardCat
;
/**
* <pre>
...
...
@@ -10,9 +9,8 @@ import org.springframework.stereotype.Repository;
* </pre>
*
* @author Danny Lee
* @since 2021-0
3-18
* @since 2021-0
4-12
*/
@Repository
public
interface
CopyrightOwnerBoardTypeMapper
extends
BaseMapper
<
CopyrightOwnerBoardType
>
{
public
interface
CopyrightOwnerBoardCatMapper
extends
BaseMapper
<
CopyrightOwnerBoardCat
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/model/CopyrightOwner.java
View file @
0a8d9a38
...
...
@@ -89,4 +89,16 @@ public class CopyrightOwner implements Serializable {
@TableField
(
exist
=
false
)
private
String
videoContentCatNames
;
@ApiModelProperty
(
"展板分类ID集合(详情使用)"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
boardCatIdList
;
@ApiModelProperty
(
"展板分类类名称集合(详情使用)"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
boardCatNameList
;
@ApiModelProperty
(
"展板分类名称(列表使用)"
)
@TableField
(
exist
=
false
)
private
String
boardCatNames
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/CopyrightOwnerBoard
Type
.java
→
src/main/java/cn/wisenergy/chnmuseum/party/model/CopyrightOwnerBoard
Cat
.java
View file @
0a8d9a38
...
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
* </p>
*
* @author Danny Lee
* @since 2021-0
3-18
* @since 2021-0
4-12
*/
@Data
@Builder
...
...
@@ -29,14 +29,14 @@ import java.io.Serializable;
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"copyright_owner_board_
type
"
)
@TableName
(
"copyright_owner_board_
cat
"
)
@ApiModel
(
value
=
"版权方展板分类"
,
description
=
"版权方展板分类"
)
public
class
CopyrightOwnerBoard
Type
implements
Serializable
{
public
class
CopyrightOwnerBoard
Cat
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"
ID
不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
message
=
"不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
@ApiModelProperty
(
"版权方ID"
)
...
...
@@ -45,8 +45,8 @@ public class CopyrightOwnerBoardType implements Serializable {
private
String
copyrightOwnerId
;
@ApiModelProperty
(
"展板分类ID"
)
@TableField
(
"board_
type
_id"
)
@TableField
(
"board_
cat
_id"
)
@NotBlank
(
message
=
"展板分类ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
board
Type
Id
;
private
String
board
Cat
Id
;
}
src/main/java/cn/wisenergy/chnmuseum/party/service/CopyrightOwnerBoard
Type
Service.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/CopyrightOwnerBoard
Cat
Service.java
View file @
0a8d9a38
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoard
Type
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoard
Cat
;
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-12
*/
public
interface
CopyrightOwnerBoard
TypeService
extends
IService
<
CopyrightOwnerBoardType
>
{
public
interface
CopyrightOwnerBoard
CatService
extends
IService
<
CopyrightOwnerBoardCat
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/CopyrightOwnerBoard
Type
ServiceImpl.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/CopyrightOwnerBoard
Cat
ServiceImpl.java
View file @
0a8d9a38
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.m
apper.CopyrightOwnerBoardTypeMapper
;
import
cn.wisenergy.chnmuseum.party.m
odel.CopyrightOwnerBoardType
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerBoard
Type
Service
;
import
cn.wisenergy.chnmuseum.party.m
odel.CopyrightOwnerBoardCat
;
import
cn.wisenergy.chnmuseum.party.m
apper.CopyrightOwnerBoardCatMapper
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerBoard
Cat
Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.beans.factory.annotation.Autowired
;
/**
* <pre>
...
...
@@ -13,10 +16,13 @@ import org.springframework.stereotype.Service;
* </pre>
*
* @author Danny Lee
* @since 2021-0
3-18
* @since 2021-0
4-12
*/
@Slf4j
@Service
public
class
CopyrightOwnerBoardTypeServiceImpl
extends
ServiceImpl
<
CopyrightOwnerBoardTypeMapper
,
CopyrightOwnerBoardType
>
implements
CopyrightOwnerBoardTypeService
{
public
class
CopyrightOwnerBoardCatServiceImpl
extends
ServiceImpl
<
CopyrightOwnerBoardCatMapper
,
CopyrightOwnerBoardCat
>
implements
CopyrightOwnerBoardCatService
{
@Autowired
private
CopyrightOwnerBoardCatMapper
copyrightOwnerBoardCatMapper
;
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
0a8d9a38
...
...
@@ -26,7 +26,6 @@ import javax.annotation.Resource;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -55,6 +54,12 @@ public class CopyrightOwnerController extends BaseController {
@Resource
private
CopyrightOwnerVideoContentCatService
copyrightOwnerVideoContentCatService
;
@Resource
private
CopyrightOwnerBoardCatService
copyrightOwnerBoardCatService
;
@Resource
private
ExhibitionBoardCatService
exhibitionBoardCatService
;
@Resource
private
ExhibitionBoardService
exhibitionBoardService
;
...
...
@@ -77,6 +82,18 @@ public class CopyrightOwnerController extends BaseController {
this
.
copyrightOwnerVideoContentCatService
.
saveBatch
(
copyrightOwnerVideoContentCatList
);
}
final
List
<
String
>
boardCatIdList
=
copyrightOwner
.
getBoardCatIdList
();
if
(
boardCatIdList
!=
null
&&
!
boardCatIdList
.
isEmpty
())
{
List
<
CopyrightOwnerBoardCat
>
copyrightOwnerBoardCatList
=
new
ArrayList
<>();
for
(
String
boardCatId
:
boardCatIdList
)
{
copyrightOwnerBoardCatList
.
add
(
CopyrightOwnerBoardCat
.
builder
()
.
boardCatId
(
boardCatId
)
.
copyrightOwnerId
(
copyrightOwner
.
getId
())
.
build
());
}
this
.
copyrightOwnerBoardCatService
.
saveBatch
(
copyrightOwnerBoardCatList
);
}
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
...
...
@@ -106,6 +123,22 @@ public class CopyrightOwnerController extends BaseController {
}
this
.
copyrightOwnerVideoContentCatService
.
saveBatch
(
copyrightOwnerVideoContentCatList
);
}
final
List
<
String
>
boardCatIdList
=
copyrightOwner
.
getBoardCatIdList
();
if
(
boardCatIdList
!=
null
&&
!
boardCatIdList
.
isEmpty
())
{
LambdaUpdateWrapper
<
CopyrightOwnerBoardCat
>
updateWrapper
=
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerBoardCat:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
());
this
.
copyrightOwnerBoardCatService
.
remove
(
updateWrapper
);
List
<
CopyrightOwnerBoardCat
>
copyrightOwnerBoardCatList
=
new
ArrayList
<>();
for
(
String
boardCatId
:
boardCatIdList
)
{
copyrightOwnerBoardCatList
.
add
(
CopyrightOwnerBoardCat
.
builder
()
.
boardCatId
(
boardCatId
)
.
copyrightOwnerId
(
copyrightOwner
.
getId
())
.
build
());
}
this
.
copyrightOwnerBoardCatService
.
saveBatch
(
copyrightOwnerBoardCatList
);
}
if
(
flag
)
{
return
getSuccessResult
();
}
...
...
@@ -120,9 +153,7 @@ public class CopyrightOwnerController extends BaseController {
@ApiOperation
(
value
=
"获取版权方全部列表(无分页)"
,
notes
=
"获取版权方全部列表(无分页)"
)
public
Map
<
String
,
Object
>
getCopyrightOwnerList
(
@RequestParam
(
"copyrightOwnerType"
)
CopyrightOwnerTypeEnum
copyrightOwnerTypeEnum
)
{
LambdaQueryWrapper
<
CopyrightOwner
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwner
>
lambdaQuery
().
eq
(
CopyrightOwner:
:
getOwnerType
,
copyrightOwnerTypeEnum
.
name
());
lambdaQueryWrapper
.
eq
(
CopyrightOwner:
:
getDeleted
,
false
);
lambdaQueryWrapper
.
le
(
CopyrightOwner:
:
getExpireDateStart
,
TimeUtils
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()))
.
ge
(
CopyrightOwner:
:
getExpireDateEnd
,
TimeUtils
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
lambdaQueryWrapper
.
le
(
CopyrightOwner:
:
getExpireDateStart
,
TimeUtils
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
())).
ge
(
CopyrightOwner:
:
getExpireDateEnd
,
TimeUtils
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
lambdaQueryWrapper
.
orderByDesc
(
CopyrightOwner:
:
getCreateTime
);
List
<
CopyrightOwner
>
copyrightOwnerList
=
copyrightOwnerService
.
list
(
lambdaQueryWrapper
);
return
getResult
(
copyrightOwnerList
);
...
...
@@ -148,8 +179,8 @@ public class CopyrightOwnerController extends BaseController {
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
CopyrightOwner:
:
get
CreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
CopyrightOwner:
:
get
CreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
queryWrapper
.
ge
(
CopyrightOwner:
:
get
ExpireDateEnd
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
))
.
le
(
CopyrightOwner:
:
get
ExpireDateStart
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
CopyrightOwner:
:
getCreateTime
);
...
...
@@ -168,19 +199,18 @@ public class CopyrightOwnerController extends BaseController {
if
(
CopyrightOwnerTypeEnum
.
VIDEO_CONTENT
.
name
().
equals
(
genericPageParam
.
getOwnerType
()))
{
List
<
CopyrightOwnerVideoContentCat
>
copyrightOwnerVideoContentCatList
=
this
.
copyrightOwnerVideoContentCatService
.
list
(
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaQuery
().
eq
(
CopyrightOwnerVideoContentCat:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
()));
if
(!
copyrightOwnerVideoContentCatList
.
isEmpty
())
{
Set
<
String
>
idList
=
copyrightOwnerVideoContentCatList
.
stream
().
map
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
).
collect
(
Collectors
.
toSe
t
());
final
List
<
String
>
idList
=
copyrightOwnerVideoContentCatList
.
stream
().
map
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
).
distinct
().
collect
(
Collectors
.
toLis
t
());
List
<
VideoContentCat
>
videoContentCatList
=
this
.
videoContentCatService
.
listByIds
(
idList
);
String
videoContentCatNames
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
setVideoContentCatNames
(
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
>
videoContentCatIdList
=
exhibitionBoardList
.
stream
().
map
(
ExhibitionBoard:
:
getVideoContentCatId
).
collect
(
Collectors
.
toSet
());
List
<
VideoContentCat
>
videoContentCatList
=
this
.
videoContentCatService
.
listByIds
(
videoContentCatIdList
);
String
videoContentCatNames
=
videoContentCatList
.
stream
().
map
(
VideoContentCat:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
setVideoContentCatNames
(
videoContentCatNames
);
final
List
<
CopyrightOwnerBoardCat
>
copyrightOwnerBoardCatList
=
this
.
copyrightOwnerBoardCatService
.
list
(
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaQuery
().
eq
(
CopyrightOwnerBoardCat:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
()));
if
(!
copyrightOwnerBoardCatList
.
isEmpty
())
{
List
<
String
>
idList
=
copyrightOwnerBoardCatList
.
stream
().
map
(
CopyrightOwnerBoardCat:
:
getBoardCatId
).
distinct
().
collect
(
Collectors
.
toList
());
final
List
<
ExhibitionBoardCat
>
exhibitionBoardCatList
=
this
.
exhibitionBoardCatService
.
listByIds
(
idList
);
final
String
exhibitionBoardCatNames
=
exhibitionBoardCatList
.
stream
().
map
(
ExhibitionBoardCat:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
setBoardCatNames
(
exhibitionBoardCatNames
);
}
}
}
...
...
@@ -209,6 +239,18 @@ public class CopyrightOwnerController extends BaseController {
}
}
}
if
(
CopyrightOwnerTypeEnum
.
EXHIBITION_BOARD
.
name
().
equals
(
ownerType
))
{
final
List
<
CopyrightOwnerBoardCat
>
copyrightOwnerBoardCatList
=
this
.
copyrightOwnerBoardCatService
.
list
(
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaQuery
().
eq
(
CopyrightOwnerBoardCat:
:
getCopyrightOwnerId
,
id
));
if
(!
copyrightOwnerBoardCatList
.
isEmpty
())
{
final
List
<
String
>
boardCatIdList
=
copyrightOwnerBoardCatList
.
stream
().
map
(
CopyrightOwnerBoardCat:
:
getBoardCatId
).
distinct
().
collect
(
Collectors
.
toList
());
copyrightOwner
.
setBoardCatIdList
(
boardCatIdList
);
final
List
<
ExhibitionBoardCat
>
exhibitionBoardCatList
=
this
.
exhibitionBoardCatService
.
listByIds
(
boardCatIdList
);
if
(!
exhibitionBoardCatList
.
isEmpty
())
{
final
List
<
String
>
exhibitionBoardCatNameList
=
exhibitionBoardCatList
.
stream
().
map
(
ExhibitionBoardCat:
:
getName
).
collect
(
Collectors
.
toList
());
copyrightOwner
.
setBoardCatNameList
(
exhibitionBoardCatNameList
);
}
}
}
return
getResult
(
copyrightOwner
);
}
...
...
@@ -230,6 +272,8 @@ public class CopyrightOwnerController extends BaseController {
updateWrapper1
.
set
(
ExhibitionBoard:
:
getDeleted
,
true
);
this
.
exhibitionBoardService
.
update
(
updateWrapper1
);
//todo 删除版权方关联表
return
getSuccessResult
();
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ExhibitionBoardCatController.java
View file @
0a8d9a38
...
...
@@ -5,8 +5,10 @@ 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.CopyrightOwner
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardCat
;
import
cn.wisenergy.chnmuseum.party.model.ExhibitionBoard
;
import
cn.wisenergy.chnmuseum.party.model.ExhibitionBoardCat
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerBoardCatService
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService
;
import
cn.wisenergy.chnmuseum.party.service.ExhibitionBoardCatService
;
import
cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService
;
...
...
@@ -30,6 +32,7 @@ import javax.annotation.Resource;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
...
...
@@ -53,6 +56,8 @@ public class ExhibitionBoardCatController extends BaseController {
private
ExhibitionBoardCatService
exhibitionBoardCatService
;
@Resource
private
CopyrightOwnerService
copyrightOwnerService
;
@Resource
private
CopyrightOwnerBoardCatService
copyrightOwnerBoardCatService
;
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:cat:save")
...
...
@@ -111,14 +116,27 @@ public class ExhibitionBoardCatController extends BaseController {
updateWrapper
.
set
(
ExhibitionBoard:
:
getDeleted
,
true
);
this
.
exhibitionBoardService
.
update
(
updateWrapper
);
//todo 删除中间关联表
return
getSuccessResult
();
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"copyrightOwnerId"
,
value
=
"展板内容版权方ID"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getList"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:cat:list")
@ApiOperation
(
value
=
"获取展板分类全部列表(无分页)"
,
notes
=
"获取展板分类全部列表(无分页)"
)
public
Map
<
String
,
Object
>
getExhibitionBoardCatList
()
{
List
<
ExhibitionBoardCat
>
exhibitionBoardCatList
=
exhibitionBoardCatService
.
list
(
Wrappers
.<
ExhibitionBoardCat
>
lambdaQuery
().
eq
(
ExhibitionBoardCat:
:
getDeleted
,
false
).
orderByDesc
(
ExhibitionBoardCat:
:
getCreateTime
));
public
Map
<
String
,
Object
>
getExhibitionBoardCatList
(
@RequestParam
(
value
=
"copyrightOwnerId"
,
required
=
false
)
String
copyrightOwnerId
)
{
final
LambdaQueryWrapper
<
ExhibitionBoardCat
>
exhibitionBoardCatLambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoardCat
>
lambdaQuery
().
orderByDesc
(
ExhibitionBoardCat:
:
getCreateTime
);
if
(
StringUtils
.
isNotBlank
(
copyrightOwnerId
))
{
final
LambdaQueryWrapper
<
CopyrightOwnerBoardCat
>
queryWrapper
=
Wrappers
.<
CopyrightOwnerBoardCat
>
lambdaQuery
().
eq
(
CopyrightOwnerBoardCat:
:
getCopyrightOwnerId
,
copyrightOwnerId
);
queryWrapper
.
select
(
CopyrightOwnerBoardCat:
:
getBoardCatId
);
final
List
<
String
>
boardCatIdList
=
this
.
copyrightOwnerBoardCatService
.
listObjs
(
queryWrapper
,
Objects:
:
toString
);
exhibitionBoardCatLambdaQueryWrapper
.
in
(
ExhibitionBoardCat:
:
getId
,
boardCatIdList
);
}
List
<
ExhibitionBoardCat
>
exhibitionBoardCatList
=
exhibitionBoardCatService
.
list
(
exhibitionBoardCatLambdaQueryWrapper
);
return
getResult
(
exhibitionBoardCatList
);
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/VideoContentCatController.java
View file @
0a8d9a38
...
...
@@ -3,9 +3,11 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
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.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
;
...
...
@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
...
...
@@ -43,6 +46,9 @@ import java.util.stream.Collectors;
@Api
(
tags
=
{
"视频内容分类接口"
})
public
class
VideoContentCatController
extends
BaseController
{
@Resource
private
CopyrightOwnerVideoContentCatService
copyrightOwnerVideoContentCatService
;
@Resource
private
VideoContentCatService
videoContentCatService
;
...
...
@@ -77,11 +83,22 @@ public class VideoContentCatController extends BaseController {
return
getFailResult
();
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"copyrightOwnerId"
,
value
=
"视频内容版权方ID"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getList"
)
@RequiresAuthentication
//@RequiresPermissions("video:content:cat:list")
@ApiOperation
(
value
=
"获取视频内容分类全部列表(无分页)"
,
notes
=
"获取视频内容分类全部列表(无分页)"
)
public
Map
<
String
,
Object
>
getVideoContentCatList
()
{
List
<
VideoContentCat
>
videoContentCatList
=
videoContentCatService
.
list
(
Wrappers
.<
VideoContentCat
>
lambdaQuery
().
eq
(
VideoContentCat:
:
getDeleted
,
false
).
orderByDesc
(
VideoContentCat:
:
getCreateTime
));
public
Map
<
String
,
Object
>
getVideoContentCatList
(
@RequestParam
(
value
=
"copyrightOwnerId"
,
required
=
false
)
String
copyrightOwnerId
)
{
final
LambdaQueryWrapper
<
VideoContentCat
>
videoContentCatLambdaQueryWrapper
=
Wrappers
.<
VideoContentCat
>
lambdaQuery
().
orderByDesc
(
VideoContentCat:
:
getCreateTime
);
if
(
StringUtils
.
isNotBlank
(
copyrightOwnerId
))
{
final
LambdaQueryWrapper
<
CopyrightOwnerVideoContentCat
>
queryWrapper
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaQuery
().
eq
(
CopyrightOwnerVideoContentCat:
:
getCopyrightOwnerId
,
copyrightOwnerId
);
queryWrapper
.
select
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
);
final
List
<
String
>
videoContentCatIdList
=
this
.
copyrightOwnerVideoContentCatService
.
listObjs
(
queryWrapper
,
Objects:
:
toString
);
videoContentCatLambdaQueryWrapper
.
in
(
VideoContentCat:
:
getId
,
videoContentCatIdList
);
}
List
<
VideoContentCat
>
videoContentCatList
=
videoContentCatService
.
list
(
videoContentCatLambdaQueryWrapper
);
return
getResult
(
videoContentCatList
);
}
...
...
@@ -153,6 +170,8 @@ public class VideoContentCatController extends BaseController {
updateWrapper
.
set
(
VideoContent:
:
getDeleted
,
true
);
this
.
videoContentService
.
update
(
updateWrapper
);
//todo 删除中间关联表
return
getSuccessResult
();
}
...
...
src/main/resources/mapper/CopyrightOwnerBoard
Type
Mapper.xml
→
src/main/resources/mapper/CopyrightOwnerBoard
Cat
Mapper.xml
View file @
0a8d9a38
<?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.CopyrightOwnerBoard
Type
Mapper"
>
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerBoard
Cat
Mapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoard
Type
"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"board_type_id"
property=
"boardTypeId"
/>
</resultMap>
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoard
Cat
"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"board_cat_id"
property=
"boardCatId"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, copyright_owner_id, board_
type
_id
id, copyright_owner_id, board_
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