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
4969fe17
Commit
4969fe17
authored
Jun 15, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加主学习内容,修改学习项目、学习内容新建的逻辑
parent
7a2f8ebd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
43 deletions
+75
-43
LearningProject.java
src/main/java/cn/chnmuseum/party/model/LearningProject.java
+0
-14
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+6
-2
LearningProjectController.java
...useum/party/web/controller/LearningProjectController.java
+69
-27
No files found.
src/main/java/cn/chnmuseum/party/model/LearningProject.java
View file @
4969fe17
...
@@ -96,20 +96,6 @@ public class LearningProject implements Serializable {
...
@@ -96,20 +96,6 @@ public class LearningProject implements Serializable {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
String
>
exhibitionBoardIdList
;
private
List
<
String
>
exhibitionBoardIdList
;
// 以下字段在修改项目时使用
@ApiModelProperty
(
"项目的子学习内容所使用展板"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
minorLearningContentBoard
;
@ApiModelProperty
(
"项目的子学习内容所使用展板分类"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
minorLearningContentCatBoard
;
@ApiModelProperty
(
"项目的子学习内容所使用展板版权方"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
minorLearningContentCopyright
;
@ApiModelProperty
(
"项目的主学习内容对象"
)
@ApiModelProperty
(
"项目的主学习内容对象"
)
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
LearningContent
majorLearning
;
private
LearningContent
majorLearning
;
...
...
src/main/java/cn/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
4969fe17
...
@@ -187,7 +187,7 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -187,7 +187,7 @@ public class CopyrightOwnerController extends BaseController {
@ApiOperation
(
value
=
"根据学习项目获取版权方列表"
,
notes
=
"根据学习项目获取版权方列表"
)
@ApiOperation
(
value
=
"根据学习项目获取版权方列表"
,
notes
=
"根据学习项目获取版权方列表"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"学习项目主键"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"学习项目主键"
)
// @MethodLog(operModule = OperModule.DISPLAYCOPYRIGHT, operType = OperType.SELECT)
// @MethodLog(operModule = OperModule.DISPLAYCOPYRIGHT, operType = OperType.SELECT)
public
Map
<
String
,
Object
>
getListByLearningProjectId
(
String
learningProjectId
){
public
Map
<
String
,
Object
>
getListByLearningProjectId
(
String
learningProjectId
,
CopyrightOwnerTypeEnum
copyrightOwnerType
){
if
(
StringUtils
.
isBlank
(
learningProjectId
))
{
if
(
StringUtils
.
isBlank
(
learningProjectId
))
{
return
getFailResult
(
"学习项目不能为空"
);
return
getFailResult
(
"学习项目不能为空"
);
}
}
...
@@ -210,7 +210,11 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -210,7 +210,11 @@ public class CopyrightOwnerController extends BaseController {
}
}
// 根据主键获取这些版权方信息
// 根据主键获取这些版权方信息
List
<
CopyrightOwner
>
copyrightOwners
=
this
.
copyrightOwnerService
.
listByIds
(
list
);
LambdaQueryWrapper
<
CopyrightOwner
>
copyrightOwnerLambdaQueryWrapper
=
Wrappers
.<
CopyrightOwner
>
lambdaQuery
();
copyrightOwnerLambdaQueryWrapper
.
in
(
CopyrightOwner:
:
getId
,
list
);
copyrightOwnerLambdaQueryWrapper
.
le
(
CopyrightOwner:
:
getExpireDateStart
,
TimeUtils
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()).
toLocalDate
()).
ge
(
CopyrightOwner:
:
getExpireDateEnd
,
TimeUtils
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()).
toLocalDate
());
copyrightOwnerLambdaQueryWrapper
.
eq
(
CopyrightOwner:
:
getOwnerType
,
copyrightOwnerType
);
List
<
CopyrightOwner
>
copyrightOwners
=
this
.
copyrightOwnerService
.
list
(
copyrightOwnerLambdaQueryWrapper
);
return
getResult
(
copyrightOwners
);
return
getResult
(
copyrightOwners
);
}
}
...
...
src/main/java/cn/chnmuseum/party/web/controller/LearningProjectController.java
View file @
4969fe17
...
@@ -3,6 +3,7 @@ package cn.chnmuseum.party.web.controller;
...
@@ -3,6 +3,7 @@ package cn.chnmuseum.party.web.controller;
import
cn.chnmuseum.party.common.log.MethodLog
;
import
cn.chnmuseum.party.common.log.MethodLog
;
import
cn.chnmuseum.party.common.log.OperModule
;
import
cn.chnmuseum.party.common.log.OperModule
;
import
cn.chnmuseum.party.common.log.OperType
;
import
cn.chnmuseum.party.common.log.OperType
;
import
cn.chnmuseum.party.common.util.TimeUtils
;
import
cn.chnmuseum.party.common.validator.groups.Add
;
import
cn.chnmuseum.party.common.validator.groups.Add
;
import
cn.chnmuseum.party.common.validator.groups.Update
;
import
cn.chnmuseum.party.common.validator.groups.Update
;
import
cn.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.chnmuseum.party.common.vo.GenericPageParam
;
...
@@ -56,6 +57,13 @@ public class LearningProjectController extends BaseController {
...
@@ -56,6 +57,13 @@ public class LearningProjectController extends BaseController {
private
LearningContentBoardCatService
learningContentBoardCatService
;
private
LearningContentBoardCatService
learningContentBoardCatService
;
@Resource
@Resource
private
LearningContentCopyrightOwnerService
learningContentCopyrightOwnerService
;
private
LearningContentCopyrightOwnerService
learningContentCopyrightOwnerService
;
@Resource
private
CopyrightOwnerService
copyrightOwnerService
;
@Resource
private
ExhibitionBoardCatService
exhibitionBoardCatService
;
@Resource
private
ExhibitionBoardService
exhibitionBoardService
;
@PostMapping
(
"/save"
)
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("learning:project:save")
@RequiresAuthentication
//@RequiresPermissions("learning:project:save")
...
@@ -112,6 +120,62 @@ public class LearningProjectController extends BaseController {
...
@@ -112,6 +120,62 @@ public class LearningProjectController extends BaseController {
if
(
one
==
null
)
{
if
(
one
==
null
)
{
return
getFailResult
(
"该学习项目下没有主学习内容"
);
return
getFailResult
(
"该学习项目下没有主学习内容"
);
}
}
// 查询该学习项目的子学习内容版权方、展板分类、展板
LambdaQueryWrapper
<
LearningContent
>
lambdaQueryWrapper
=
Wrappers
.<
LearningContent
>
lambdaQuery
();
lambdaQueryWrapper
.
eq
(
LearningContent:
:
getLearningProjectId
,
learningProject
.
getId
());
lambdaQueryWrapper
.
eq
(
LearningContent:
:
getIsMajor
,
false
);
lambdaQueryWrapper
.
select
(
LearningContent:
:
getId
);
List
<
String
>
list
=
this
.
learningContentService
.
listObjs
(
lambdaQueryWrapper
,
Object:
:
toString
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
// 查询子学习内容的版权方
LambdaQueryWrapper
<
LearningContentCopyrightOwner
>
query
=
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaQuery
();
query
.
in
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
list
);
query
.
select
(
LearningContentCopyrightOwner:
:
getCopyrightOwnerId
);
List
<
String
>
list1
=
this
.
learningContentCopyrightOwnerService
.
listObjs
(
query
,
Object:
:
toString
);
// 修改主内容的版权信息中删除了子学习内容的版权信息
if
(
CollectionUtil
.
isNotEmpty
(
list1
)
&&
!
learningProject
.
getCopyrightOwnerIdList
().
containsAll
(
list1
))
{
list1
.
removeAll
(
learningProject
.
getCopyrightOwnerIdList
());
// 查询子学习内容中被删除的版权方信息
List
<
CopyrightOwner
>
copyrightOwners
=
this
.
copyrightOwnerService
.
listByIds
(
list1
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
copyrightOwners
.
forEach
(
s
->
stringBuilder
.
append
(
s
.
getName
()+
"、"
));
return
getFailResult
(
"展板版权方:"
+
stringBuilder
+
"。被子学习内容使用,不能被删除,更新失败!"
);
}
// 查询子学习内容的展板分类
LambdaQueryWrapper
<
LearningContentBoardCat
>
query1
=
Wrappers
.<
LearningContentBoardCat
>
lambdaQuery
();
query1
.
in
(
LearningContentBoardCat:
:
getLearningContentId
,
list
);
query1
.
select
(
LearningContentBoardCat:
:
getExhibitionBoardCatId
);
List
<
String
>
list2
=
this
.
learningContentBoardCatService
.
listObjs
(
query1
,
Object:
:
toString
);
// 主学习内容展板分类不能完全子学习内容的展板分类
if
(
CollectionUtil
.
isNotEmpty
(
list2
)
&&
!
learningProject
.
getExhibitionBoardCatIdList
().
containsAll
(
list2
))
{
// 差集
list2
.
removeAll
(
learningProject
.
getExhibitionBoardCatIdList
());
// 查询被删除的展板分类信息
List
<
ExhibitionBoardCat
>
learningContentBoardCats
=
this
.
exhibitionBoardCatService
.
listByIds
(
list2
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
learningContentBoardCats
.
forEach
(
s
->
stringBuilder
.
append
(
s
.
getName
()));
return
getFailResult
(
"展板类别:"
+
stringBuilder
+
"。被子学习内容使用,不能被删除,更新失败"
);
}
// 查询子学习内容的展板
LambdaQueryWrapper
<
LearningContentBoard
>
query2
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
();
query2
.
in
(
LearningContentBoard:
:
getLearningContentId
,
list
);
query2
.
select
(
LearningContentBoard:
:
getExhibitionBoardId
);
List
<
String
>
list3
=
this
.
learningContentBoardService
.
listObjs
(
query2
,
Object:
:
toString
);
// 修改主要学习内容时删除了子学习内容所使用展板
if
(
CollectionUtil
.
isNotEmpty
(
list3
)
&&
!
learningProject
.
getExhibitionBoardIdList
().
containsAll
(
list3
))
{
// 差集
list3
.
retainAll
(
learningProject
.
getExhibitionBoardIdList
());
// 查询被删除的展板信息
List
<
ExhibitionBoard
>
exhibitionBoards
=
this
.
exhibitionBoardService
.
listByIds
(
list3
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
exhibitionBoards
.
forEach
(
s
->
stringBuilder
.
append
(
s
.
getName
()));
return
getFailResult
(
"展板:"
+
stringBuilder
+
"。被子学习内容使用,不能被删除,更新失败!"
);
}
}
LearningContent
learningContent
=
LearningContent
.
builder
()
LearningContent
learningContent
=
LearningContent
.
builder
()
.
id
(
one
.
getId
())
.
id
(
one
.
getId
())
.
name
(
learningProject
.
getMajor
())
.
name
(
learningProject
.
getMajor
())
...
@@ -188,35 +252,13 @@ public class LearningProjectController extends BaseController {
...
@@ -188,35 +252,13 @@ public class LearningProjectController extends BaseController {
lambdaQuery
.
eq
(
LearningContent:
:
getLearningProjectId
,
id
);
lambdaQuery
.
eq
(
LearningContent:
:
getLearningProjectId
,
id
);
lambdaQuery
.
eq
(
LearningContent:
:
getIsMajor
,
true
);
lambdaQuery
.
eq
(
LearningContent:
:
getIsMajor
,
true
);
LearningContent
majorLearningContent
=
this
.
learningContentService
.
getOne
(
lambdaQuery
);
LearningContent
majorLearningContent
=
this
.
learningContentService
.
getOne
(
lambdaQuery
);
Map
<
String
,
Object
>
map
=
this
.
learningContentController
.
getById
(
majorLearningContent
.
getId
());
if
(
majorLearningContent
!=
null
)
{
LearningContent
data
=
(
LearningContent
)
map
.
get
(
"data"
);
Map
<
String
,
Object
>
map
=
this
.
learningContentController
.
getById
(
majorLearningContent
.
getId
());
learningProject
.
setMajorLearning
(
data
);
LearningContent
data
=
(
LearningContent
)
map
.
get
(
"data"
);
learningProject
.
setMajorLearning
(
data
);
}
// 该项目下所有的子学习内容
lambdaQuery
.
clear
();
lambdaQuery
.
eq
(
LearningContent:
:
getLearningProjectId
,
id
);
lambdaQuery
.
eq
(
LearningContent:
:
getIsMajor
,
false
);
lambdaQuery
.
select
(
LearningContent:
:
getId
);
List
<
String
>
contentIds
=
this
.
learningContentService
.
listObjs
(
lambdaQuery
,
Object:
:
toString
);
// 子学习内容所使用展板,展板分类,展板版权方
if
(
CollectionUtil
.
isNotEmpty
(
contentIds
))
{
// 展板
LambdaQueryWrapper
<
LearningContentBoard
>
in
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
().
in
(
LearningContentBoard:
:
getLearningContentId
,
contentIds
);
in
.
select
(
LearningContentBoard:
:
getExhibitionBoardId
);
List
<
String
>
contentBoards
=
this
.
learningContentBoardService
.
listObjs
(
in
,
Object:
:
toString
);
learningProject
.
setMinorLearningContentBoard
(
contentBoards
);
// 展板分类
LambdaQueryWrapper
<
LearningContentBoardCat
>
catLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoardCat
>
lambdaQuery
().
in
(
LearningContentBoardCat:
:
getLearningContentId
,
contentIds
);
catLambdaQueryWrapper
.
select
(
LearningContentBoardCat:
:
getExhibitionBoardCatId
);
List
<
String
>
list
=
this
.
learningContentBoardCatService
.
listObjs
(
catLambdaQueryWrapper
,
Object:
:
toString
);
learningProject
.
setMinorLearningContentCatBoard
(
list
);
// 展板版权方
LambdaQueryWrapper
<
LearningContentCopyrightOwner
>
lambdaQueryWrapper
=
Wrappers
.<
LearningContentCopyrightOwner
>
lambdaQuery
().
in
(
LearningContentCopyrightOwner:
:
getLearningContentId
,
contentIds
);
lambdaQueryWrapper
.
select
(
LearningContentCopyrightOwner:
:
getCopyrightOwnerId
);
List
<
String
>
list1
=
this
.
learningContentCopyrightOwnerService
.
listObjs
(
lambdaQueryWrapper
,
Object:
:
toString
);
learningProject
.
setMinorLearningContentCopyright
(
list1
);
}
return
getResult
(
learningProject
);
return
getResult
(
learningProject
);
}
}
...
...
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