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
f3d0ef45
Commit
f3d0ef45
authored
Jun 10, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整新建学习项目、内容。
parent
d5af49a9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
8 deletions
+113
-8
LearningProject.java
src/main/java/cn/chnmuseum/party/model/LearningProject.java
+4
-0
ExhibitionBoardController.java
...useum/party/web/controller/ExhibitionBoardController.java
+82
-4
LearningContentController.java
...useum/party/web/controller/LearningContentController.java
+13
-4
LearningProjectController.java
...useum/party/web/controller/LearningProjectController.java
+14
-0
No files found.
src/main/java/cn/chnmuseum/party/model/LearningProject.java
View file @
f3d0ef45
...
...
@@ -70,4 +70,8 @@ public class LearningProject implements Serializable {
@TableField
(
exist
=
false
)
private
String
exhibitionBoardNames
;
@ApiModelProperty
(
"主要学习内容"
)
@TableField
(
exist
=
false
)
private
LearningContent
majorLearningContent
;
}
src/main/java/cn/chnmuseum/party/web/controller/ExhibitionBoardController.java
View file @
f3d0ef45
...
...
@@ -67,6 +67,8 @@ public class ExhibitionBoardController extends BaseController {
private
LearningContentBoardService
learningContentBoardService
;
@Resource
private
LearningContentService
learningContentService
;
@Resource
private
LearningProjectService
learningProjectService
;
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:save")
...
...
@@ -180,7 +182,7 @@ public class ExhibitionBoardController extends BaseController {
for
(
String
datumId
:
datumIdList
)
{
final
Asset
asset
=
this
.
assetService
.
getById
(
datumId
);
if
(
asset
==
null
)
{
if
(
asset
==
null
)
{
continue
;
}
if
(
asset
.
getPublished
())
{
...
...
@@ -191,7 +193,7 @@ public class ExhibitionBoardController extends BaseController {
}
// 2021-05-31修改后
audioIdList
.
addAll
(
datumIdList
);
removeNotInIds
(
audioIdList
,
exhibitionBoard
.
getId
());
removeNotInIds
(
audioIdList
,
exhibitionBoard
.
getId
());
final
ExhibitionBoard
one
=
this
.
exhibitionBoardService
.
getById
(
exhibitionBoard
.
getId
());
one
.
setAuditStatus
(
AuditStatusEnum
.
TBC
.
name
());
...
...
@@ -221,13 +223,74 @@ public class ExhibitionBoardController extends BaseController {
*
* @param assetIds
*/
public
void
removeNotInIds
(
List
<
String
>
assetIds
,
String
refItemId
)
{
public
void
removeNotInIds
(
List
<
String
>
assetIds
,
String
refItemId
)
{
LambdaQueryWrapper
<
Asset
>
assetWrapper
=
new
QueryWrapper
<
Asset
>().
lambda
()
.
eq
(
Asset:
:
getRefItemId
,
refItemId
)
.
notIn
(
Asset:
:
getId
,
assetIds
);
boolean
remove
=
assetService
.
remove
(
assetWrapper
);
}
@PostMapping
(
"/getListByLearningId"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:list")
@ApiOperation
(
value
=
"根据学习项目获取展板全部列表(无分页)"
,
notes
=
"根据学习项目获取展板全部列表(无分页)"
)
@MethodLog
(
operModule
=
OperModule
.
DISPLAYCONTENT
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
getExhibitionBoardList
(
String
learningProjectId
)
{
if
(
StringUtils
.
isBlank
(
learningProjectId
))
{
return
getFailResult
(
"学习项目为空"
);
}
// 查询该学习项目的主要学习内容
LambdaQueryWrapper
<
LearningContent
>
lambdaQueryWrapper
=
Wrappers
.<
LearningContent
>
lambdaQuery
();
lambdaQueryWrapper
.
eq
(
LearningContent:
:
getLearningProjectId
,
learningProjectId
);
lambdaQueryWrapper
.
eq
(
LearningContent:
:
getIsMajor
,
true
);
LearningContent
one
=
this
.
learningContentService
.
getOne
(
lambdaQueryWrapper
);
// 查询主要学习内容的展板id
final
LambdaQueryWrapper
<
LearningContentBoard
>
learningContentBoardLambdaQueryWrapper
=
Wrappers
.<
LearningContentBoard
>
lambdaQuery
();
learningContentBoardLambdaQueryWrapper
.
eq
(
LearningContentBoard:
:
getLearningContentId
,
one
.
getId
());
List
<
LearningContentBoard
>
list
=
this
.
learningContentBoardService
.
list
(
learningContentBoardLambdaQueryWrapper
);
List
<
String
>
boardId
=
list
.
stream
().
map
(
LearningContentBoard:
:
getExhibitionBoardId
).
collect
(
Collectors
.
toList
());
List
<
ExhibitionBoard
>
exhibitionBoardList
=
exhibitionBoardService
.
listByIds
(
boardId
);
for
(
ExhibitionBoard
exhibitionBoard
:
exhibitionBoardList
)
{
if
(
exhibitionBoard
.
getBoardCopyrightOwnerId
()
!=
null
)
{
final
CopyrightOwner
copyrightOwner
=
this
.
copyrightOwnerService
.
getById
(
exhibitionBoard
.
getBoardCopyrightOwnerId
());
if
(
copyrightOwner
==
null
)
{
exhibitionBoard
.
setBoardCopyrightOwnerName
(
"对应的展板版权方已被删除"
);
}
else
{
exhibitionBoard
.
setBoardCopyrightOwnerName
(
copyrightOwner
.
getName
());
}
}
if
(
exhibitionBoard
.
getVideoContentCopyrightOwnerId
()
!=
null
)
{
final
CopyrightOwner
copyrightOwner
=
this
.
copyrightOwnerService
.
getById
(
exhibitionBoard
.
getVideoContentCopyrightOwnerId
());
if
(
copyrightOwner
==
null
)
{
exhibitionBoard
.
setVideoContentCopyrightOwnerName
(
"对应的视频内容版权方已被删除"
);
}
else
{
exhibitionBoard
.
setVideoContentCopyrightOwnerName
(
copyrightOwner
.
getName
());
}
}
if
(
exhibitionBoard
.
getExhibitionBoardCatId
()
!=
null
)
{
final
ExhibitionBoardCat
exhibitionBoardCat
=
this
.
exhibitionBoardCatService
.
getById
(
exhibitionBoard
.
getExhibitionBoardCatId
());
if
(
exhibitionBoardCat
==
null
)
{
exhibitionBoard
.
setExhibitionBoardCatName
(
"对应的展板分类已被删除"
);
}
else
{
exhibitionBoard
.
setExhibitionBoardCatName
(
exhibitionBoardCat
.
getName
());
}
}
if
(
exhibitionBoard
.
getVideoContentId
()
!=
null
)
{
String
videoContentId
=
exhibitionBoard
.
getVideoContentId
();
final
VideoContent
videoContent
=
this
.
videoContentService
.
getById
(
videoContentId
);
if
(
videoContent
==
null
)
{
exhibitionBoard
.
setVideoList
(
Collections
.
emptyList
());
}
else
{
exhibitionBoard
.
setVideoContentName
(
videoContent
.
getName
());
final
List
<
Asset
>
videoList
=
this
.
assetService
.
list
(
Wrappers
.<
Asset
>
lambdaQuery
().
eq
(
Asset:
:
getRefItemId
,
videoContentId
).
eq
(
Asset:
:
getPublished
,
true
));
exhibitionBoard
.
setVideoList
(
videoList
);
}
}
}
return
getResult
(
exhibitionBoardList
);
}
@PostMapping
(
"/getList"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:list")
@ApiOperation
(
value
=
"获取展板全部列表(无分页)"
,
notes
=
"获取展板全部列表(无分页)"
)
...
...
@@ -503,7 +566,7 @@ public class ExhibitionBoardController extends BaseController {
// 查询学习内容,判断是否已全部下架
if
(
CollectionUtil
.
isNotEmpty
(
collect
))
{
LambdaQueryWrapper
<
LearningContent
>
learningContentLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
learningContentLambdaQueryWrapper
.
in
(
LearningContent:
:
getId
,
collect
);
learningContentLambdaQueryWrapper
.
in
(
LearningContent:
:
getId
,
collect
);
List
<
LearningContent
>
list1
=
this
.
learningContentService
.
list
(
learningContentLambdaQueryWrapper
);
for
(
LearningContent
learningContent
:
list1
)
{
if
(
learningContent
.
getPublished
())
{
...
...
@@ -539,6 +602,21 @@ public class ExhibitionBoardController extends BaseController {
})
@MethodLog
(
operModule
=
OperModule
.
DISPLAYCONTENT
,
operType
=
OperType
.
DELETE
)
public
Map
<
String
,
Object
>
deleteExhibitionBoard
(
@PathVariable
(
"id"
)
String
id
)
{
// 查询该展板是否被子学习内容使用
final
LambdaQueryWrapper
<
LearningContentBoard
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
LearningContentBoard:
:
getExhibitionBoardId
,
id
);
queryWrapper
.
select
(
LearningContentBoard:
:
getLearningContentId
);
List
<
LearningContentBoard
>
list
=
this
.
learningContentBoardService
.
list
(
queryWrapper
);
List
<
String
>
collect
=
list
.
stream
().
map
(
LearningContentBoard:
:
getLearningContentId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
LearningContent
>
boardLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
boardLambdaQueryWrapper
.
in
(
LearningContent:
:
getId
,
collect
);
List
<
LearningContent
>
learningContents
=
this
.
learningContentService
.
list
(
boardLambdaQueryWrapper
);
for
(
LearningContent
learningContent
:
learningContents
)
{
if
(!
learningContent
.
getIsMajor
())
{
return
getFailResult
(
"该展板被子学习内容使用,不能被删除!"
);
}
}
TUser
user
=
getcurUser
();
final
ExhibitionBoard
exhibitionBoard
=
this
.
exhibitionBoardService
.
getById
(
id
);
final
Audit
audit
=
Audit
.
builder
()
...
...
src/main/java/cn/chnmuseum/party/web/controller/LearningContentController.java
View file @
f3d0ef45
...
...
@@ -71,14 +71,14 @@ public class LearningContentController extends BaseController {
private
AuditService
auditService
;
@Resource
private
AssetService
assetService
;
@Autowired
@Autowired
TOrganService
organService
;
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("learning:content:save")
@ApiOperation
(
value
=
"添加学习内容"
,
notes
=
"添加学习内容"
)
@MethodLog
(
operModule
=
OperModule
.
LEARNCONTENT
,
operType
=
OperType
.
ADD
)
public
Map
<
String
,
Object
>
saveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
LearningContent
learningContent
)
{
public
Map
<
String
,
Object
>
saveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
LearningContent
learningContent
,
Boolean
isMajor
)
{
TUser
tUser1
=
getcurUser
();
if
(
"1"
.
equals
(
tUser1
.
getType
())){
learningContent
.
setCreateType
(
1
);
...
...
@@ -112,6 +112,12 @@ public class LearningContentController extends BaseController {
}
else
{
learningContent
.
setSortorder
(
1
);
}
// 如果isMajor为null则新建学习内容为子学习内容
if
(
isMajor
==
null
)
{
learningContent
.
setIsMajor
(
false
);
}
else
{
learningContent
.
setIsMajor
(
true
);
}
// 保存业务节点信息
boolean
result
=
learningContentService
.
save
(
learningContent
);
final
String
learningContentId
=
learningContent
.
getId
();
...
...
@@ -311,7 +317,7 @@ public class LearningContentController extends BaseController {
.
eq
(
LearningContentBoard:
:
getLearningContentId
,
learningContent
.
getId
());
// int exhibitionBoardCount = this.learningContentBoardService.count(lambdaQueryWrapper);
List
<
String
>
exhibitionBoardIds
=
learningContentBoardService
.
listObjs
(
lambdaQueryWrapper
,
Object:
:
toString
);
LambdaQueryWrapper
<
ExhibitionBoard
>
ExhibitionBoardIn
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
in
(
ExhibitionBoard:
:
getId
,
exhibitionBoardIds
);
LambdaQueryWrapper
<
ExhibitionBoard
>
ExhibitionBoardIn
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
in
(
ExhibitionBoard:
:
getId
,
exhibitionBoardIds
)
.
eq
(
ExhibitionBoard:
:
getPublished
,
true
)
;
int
count
=
exhibitionBoardService
.
count
(
ExhibitionBoardIn
);
// learningContent.setExhibitionBoardCount(exhibitionBoardCount);
learningContent
.
setExhibitionBoardCount
(
count
);
...
...
@@ -432,7 +438,10 @@ public class LearningContentController extends BaseController {
// final List<String> exhibitionBoardIdList = this.learningContentBoardService.listObjs(queryWrapper2, Object::toString);
if
(!
exhibitionBoardIdList
.
isEmpty
())
{
List
<
ExhibitionBoard
>
exhibitionBoardList
=
this
.
exhibitionBoardService
.
listByIds
(
exhibitionBoardIdList
);
LambdaQueryWrapper
<
ExhibitionBoard
>
lambdaQuery
=
Wrappers
.
lambdaQuery
();
lambdaQuery
.
ne
(
ExhibitionBoard:
:
getPublished
,
false
);
lambdaQuery
.
in
(
ExhibitionBoard:
:
getId
,
exhibitionBoardIdList
);
List
<
ExhibitionBoard
>
exhibitionBoardList
=
this
.
exhibitionBoardService
.
list
(
lambdaQuery
);
//设置sortorder ,然后在排序
exhibitionBoardList
.
stream
().
forEach
(
eb
->
{
exhibitionBoardIdListNew
.
stream
().
forEach
(
lcb
->
{
...
...
src/main/java/cn/chnmuseum/party/web/controller/LearningProjectController.java
View file @
f3d0ef45
...
...
@@ -21,6 +21,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresAuthentication
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -46,6 +47,8 @@ public class LearningProjectController extends BaseController {
private
LearningProjectService
learningProjectService
;
@Resource
private
LearningContentService
learningContentService
;
@Autowired
private
LearningContentController
learningContentController
;
@PostMapping
(
"/save"
)
@RequiresAuthentication
//@RequiresPermissions("learning:project:save")
...
...
@@ -54,6 +57,17 @@ public class LearningProjectController extends BaseController {
public
Map
<
String
,
Object
>
saveLearningProject
(
@Validated
(
value
=
{
Add
.
class
})
LearningProject
learningProject
)
{
// 保存业务节点信息
boolean
result
=
learningProjectService
.
save
(
learningProject
);
if
(!
result
)
{
return
getFailResult
();
}
// 该学习项目下的主学习内容
LearningContent
majorLearningContent
=
learningProject
.
getMajorLearningContent
();
majorLearningContent
.
setLearningProjectId
(
learningProject
.
getId
());
majorLearningContent
.
setApplicableScope
(
"ALL_PLAT"
);
Map
<
String
,
Object
>
resultMap
=
learningContentController
.
saveLearningContent
(
majorLearningContent
,
true
);
if
(!
resultMap
.
get
(
"resultCode"
).
equals
(
"200"
))
{
return
getFailResult
();
}
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
...
...
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