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
0a698da7
Commit
0a698da7
authored
Jun 16, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
2e53c8a0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
8 deletions
+92
-8
ListUtil.java
src/main/java/cn/chnmuseum/party/common/util/ListUtil.java
+29
-0
ExhibitionBoardController.java
...useum/party/web/controller/ExhibitionBoardController.java
+2
-1
LearningProjectController.java
...useum/party/web/controller/LearningProjectController.java
+57
-5
VideoContentCatController.java
...useum/party/web/controller/VideoContentCatController.java
+4
-2
No files found.
src/main/java/cn/chnmuseum/party/common/util/ListUtil.java
0 → 100644
View file @
0a698da7
package
cn
.
chnmuseum
.
party
.
common
.
util
;
import
cn.hutool.core.collection.CollectionUtil
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @description:
* @author: nh
* @create: 2021-06-16 09:40
**/
public
class
ListUtil
{
/**
* 比较两个list的值,不比较顺序
* @return
*/
public
static
boolean
compareValue
(
List
list1
,
List
list2
){
if
(
CollectionUtil
.
isEmpty
(
list1
)
||
CollectionUtil
.
isEmpty
(
list2
))
{
return
false
;
}
Collections
.
sort
(
list1
);
Collections
.
sort
(
list2
);
return
list1
.
equals
(
list2
);
}
}
src/main/java/cn/chnmuseum/party/web/controller/ExhibitionBoardController.java
View file @
0a698da7
...
...
@@ -575,6 +575,7 @@ public class ExhibitionBoardController extends BaseController {
if
(
CollectionUtil
.
isNotEmpty
(
collect
))
{
LambdaQueryWrapper
<
LearningContent
>
learningContentLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
learningContentLambdaQueryWrapper
.
in
(
LearningContent:
:
getId
,
collect
);
learningContentLambdaQueryWrapper
.
eq
(
LearningContent:
:
getIsMajor
,
false
);
List
<
LearningContent
>
list1
=
this
.
learningContentService
.
list
(
learningContentLambdaQueryWrapper
);
for
(
LearningContent
learningContent
:
list1
)
{
if
(
learningContent
.
getPublished
())
{
...
...
@@ -609,7 +610,7 @@ 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
();
// 查询展板对应的学习内容id
queryWrapper
.
eq
(
LearningContentBoard:
:
getExhibitionBoardId
,
id
);
...
...
src/main/java/cn/chnmuseum/party/web/controller/LearningProjectController.java
View file @
0a698da7
...
...
@@ -3,6 +3,7 @@ package cn.chnmuseum.party.web.controller;
import
cn.chnmuseum.party.common.log.MethodLog
;
import
cn.chnmuseum.party.common.log.OperModule
;
import
cn.chnmuseum.party.common.log.OperType
;
import
cn.chnmuseum.party.common.util.ListUtil
;
import
cn.chnmuseum.party.common.util.TimeUtils
;
import
cn.chnmuseum.party.common.validator.groups.Add
;
import
cn.chnmuseum.party.common.validator.groups.Update
;
...
...
@@ -21,6 +22,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.hibernate.validator.constraints.Length
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -28,6 +30,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotBlank
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -72,7 +75,12 @@ public class LearningProjectController extends BaseController {
@MethodLog
(
operModule
=
OperModule
.
LEARNPROJECT
,
operType
=
OperType
.
ADD
)
@Transactional
public
Map
<
String
,
Object
>
saveLearningProject
(
@Validated
(
value
=
{
Add
.
class
})
LearningProject
learningProject
)
{
LambdaQueryWrapper
<
LearningProject
>
lambdaQuery
=
Wrappers
.
lambdaQuery
();
lambdaQuery
.
eq
(
LearningProject:
:
getName
,
learningProject
.
getName
());
LearningProject
one
=
learningProjectService
.
getOne
(
lambdaQuery
);
if
(
one
!=
null
)
{
return
getFailResult
(
"学习项目名称已存在!"
);
}
// 保存业务节点信息
boolean
result
=
learningProjectService
.
save
(
learningProject
);
if
(!
result
)
{
...
...
@@ -109,10 +117,28 @@ public class LearningProjectController extends BaseController {
@MethodLog
(
operModule
=
OperModule
.
LEARNPROJECT
,
operType
=
OperType
.
UPDATE
)
@Transactional
public
Map
<
String
,
Object
>
updateLearningProject
(
@Validated
(
value
=
{
Update
.
class
})
LearningProject
learningProject
)
{
boolean
flag
=
learningProjectService
.
updateById
(
learningProject
);
if
(!
flag
)
{
return
getFailResult
();
// 是否重名
LambdaQueryWrapper
<
LearningProject
>
lambdaQuery1
=
Wrappers
.<
LearningProject
>
lambdaQuery
();
lambdaQuery1
.
eq
(
LearningProject:
:
getName
,
learningProject
.
getName
()).
ne
(
LearningProject:
:
getId
,
learningProject
.
getId
());
LearningProject
one1
=
learningProjectService
.
getOne
(
lambdaQuery1
);
if
(
one1
!=
null
)
{
return
getFailResult
(
"学习项目名已存在!"
);
}
StringBuilder
resultMsg
=
new
StringBuilder
();
// 查询学习项目原有信息
LearningProject
project
=
learningProjectService
.
getById
(
learningProject
.
getId
());
// 项目基本信息被修改
if
(!
project
.
getName
().
equals
(
learningProject
.
getName
())
||
!
project
.
getRemarks
().
equals
(
learningProject
.
getRemarks
()))
{
boolean
flag
=
learningProjectService
.
updateById
(
learningProject
);
if
(!
flag
)
{
return
getFailResult
();
}
resultMsg
.
append
(
"项目信息修改成功,"
);
}
else
{
resultMsg
.
append
(
"未修改项目信息,"
);
}
// 查询项目的主学习内容
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
LearningContent:
:
getLearningProjectId
,
learningProject
.
getId
());
...
...
@@ -121,10 +147,25 @@ public class LearningProjectController extends BaseController {
if
(
one
==
null
)
{
return
getFailResult
(
"该学习项目下没有主学习内容"
);
}
// 判断是否修改主学习内容
String
learningProjectMajorName
=
learningProject
.
getMajor
();
String
cover
=
learningProject
.
getCover
();
List
<
String
>
copyrightOwnerIdList
=
learningProject
.
getCopyrightOwnerIdList
();
List
<
String
>
exhibitionBoardCatIdList
=
learningProject
.
getExhibitionBoardCatIdList
();
List
<
String
>
exhibitionBoardIdList
=
learningProject
.
getExhibitionBoardIdList
();
if
(
one
.
getName
().
equals
(
learningProjectMajorName
)
&&
one
.
getCover
().
equals
(
cover
)
&&
ListUtil
.
compareValue
(
copyrightOwnerIdList
,
one
.
getCopyrightOwnerIdList
())
&&
ListUtil
.
compareValue
(
exhibitionBoardCatIdList
,
one
.
getExhibitionBoardCatIdList
())
&&
ListUtil
.
compareValue
(
exhibitionBoardIdList
,
one
.
getExhibitionBoardIdList
()))
{
resultMsg
.
append
(
"未修改项目主学习内容信息。"
);
return
getSuccessResult
(
resultMsg
.
toString
());
}
// 查询该学习项目的子学习内容版权方、展板分类、展板
LambdaQueryWrapper
<
LearningContent
>
lambdaQueryWrapper
=
Wrappers
.
lambdaQuery
();
lambdaQueryWrapper
.
eq
(
LearningContent:
:
getLearningProjectId
,
learningProject
.
getId
());
//
lambdaQueryWrapper.eq(LearningContent::getIsMajor, false);
lambdaQueryWrapper
.
eq
(
LearningContent:
:
getIsMajor
,
false
);
lambdaQueryWrapper
.
select
(
LearningContent:
:
getId
);
List
<
String
>
list
=
this
.
learningContentService
.
listObjs
(
lambdaQueryWrapper
,
Object:
:
toString
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
...
...
@@ -208,6 +249,10 @@ public class LearningProjectController extends BaseController {
.
exhibitionBoardCatIdList
(
learningProject
.
getExhibitionBoardCatIdList
())
.
exhibitionBoardIdList
(
learningProject
.
getExhibitionBoardIdList
()).
build
();
Map
<
String
,
Object
>
map
=
this
.
learningContentController
.
updateLearningContent
(
learningContent
);
resultMsg
.
append
(
"修改学习内容已提交,待审核!"
);
if
(
map
.
get
(
"resultCode"
).
equals
(
"200"
))
{
map
.
replace
(
"message"
,
resultMsg
);
}
return
map
;
}
...
...
@@ -302,6 +347,13 @@ public class LearningProjectController extends BaseController {
})
@MethodLog
(
operModule
=
OperModule
.
LEARNPROJECT
,
operType
=
OperType
.
DELETE
)
public
Map
<
String
,
Object
>
deleteLearningProject
(
@PathVariable
(
"id"
)
String
id
)
{
// 项目下的学习内容id
// LambdaQueryWrapper<LearningContent> queryWrapper = Wrappers.<LearningContent>lambdaQuery();
// queryWrapper.eq(LearningContent::getLearningProjectId, id);
// queryWrapper.select(LearningContent::getId);
// List<String> list = this.learningContentService.listObjs(queryWrapper, Object::toString);
// 删除
// this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getLearningContentId, list));
//按照王亭亭的要求 删除学习项目,不删除学习内容 所以注释掉下面一行代码
// this.learningContentService.remove(Wrappers.<LearningContent>lambdaUpdate().eq(LearningContent::getLearningProjectId, id));
int
count
=
this
.
learningContentService
.
count
(
Wrappers
.<
LearningContent
>
lambdaUpdate
().
eq
(
LearningContent:
:
getLearningProjectId
,
id
).
last
(
"LIMIT 1"
));
...
...
src/main/java/cn/chnmuseum/party/web/controller/VideoContentCatController.java
View file @
0a698da7
...
...
@@ -184,11 +184,13 @@ public class VideoContentCatController extends BaseController {
@MethodLog
(
operModule
=
OperModule
.
VIDEOCLASSIFY
,
operType
=
OperType
.
DELETE
)
public
Map
<
String
,
Object
>
deleteVideoContentCat
(
@PathVariable
(
"id"
)
String
id
)
{
// 该视频分类正在被使用时,不能被删除
final
LambdaUpdateWrapper
<
CopyrightOwnerVideoContentCat
>
updateWrapper1
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
,
id
);
List
<
CopyrightOwnerVideoContentCat
>
list
=
this
.
copyrightOwnerVideoContentCatService
.
list
(
update
Wrapper1
);
LambdaQueryWrapper
<
CopyrightOwnerVideoContentCat
>
lambdaQueryWrapper1
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaQuery
().
eq
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
,
id
);
List
<
CopyrightOwnerVideoContentCat
>
list
=
this
.
copyrightOwnerVideoContentCatService
.
list
(
lambdaQuery
Wrapper1
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
return
getFailResult
(
"该视频分类正在被使用,不能删除"
);
}
final
LambdaUpdateWrapper
<
CopyrightOwnerVideoContentCat
>
updateWrapper1
=
Wrappers
.<
CopyrightOwnerVideoContentCat
>
lambdaUpdate
().
eq
(
CopyrightOwnerVideoContentCat:
:
getVideoContentCatId
,
id
);
// 删除视频分类信息
this
.
videoContentCatService
.
removeById
(
id
);
// 删除版权方和视频分类对应信息
...
...
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