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
fdea5073
Commit
fdea5073
authored
May 13, 2021
by
jiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG修改==》》单位管理员创建的学习内容不需要通过审核,直接变成通过
parent
0d271418
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
LearningContentController.java
...useum/party/web/controller/LearningContentController.java
+30
-2
No files found.
src/main/java/cn/chnmuseum/party/web/controller/LearningContentController.java
View file @
fdea5073
...
@@ -25,6 +25,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -25,6 +25,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresAuthentication
;
import
org.apache.shiro.authz.annotation.RequiresAuthentication
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -91,7 +92,14 @@ public class LearningContentController extends BaseController {
...
@@ -91,7 +92,14 @@ public class LearningContentController extends BaseController {
if
(
tUser
!=
null
)
{
if
(
tUser
!=
null
)
{
learningContent
.
setOrganCode
(
tUser
.
getOrgCode
());
learningContent
.
setOrganCode
(
tUser
.
getOrgCode
());
}
}
//
boolean
nonUnitRole
=
!
isUnitRole
(
tUser
);
if
(
nonUnitRole
){
learningContent
.
setAuditStatus
(
AuditStatusEnum
.
TBC
.
name
());
learningContent
.
setAuditStatus
(
AuditStatusEnum
.
TBC
.
name
());
}
else
{
//是单位管理员直接变成通过
learningContent
.
setAuditStatus
(
AuditStatusEnum
.
APPROVED_FINAL
.
name
());
}
learningContent
.
setPublished
(
false
);
learningContent
.
setPublished
(
false
);
QueryWrapper
<
LearningContent
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
LearningContent
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"max(sortorder) as sortorder"
);
queryWrapper
.
select
(
"max(sortorder) as sortorder"
);
...
@@ -136,7 +144,7 @@ public class LearningContentController extends BaseController {
...
@@ -136,7 +144,7 @@ public class LearningContentController extends BaseController {
}
}
// 返回操作结果
// 返回操作结果
if
(
result
)
{
if
(
result
&&
nonUnitRole
)
{
final
Audit
audit
=
Audit
.
builder
()
final
Audit
audit
=
Audit
.
builder
()
.
content
(
learningContent
.
getName
())
.
content
(
learningContent
.
getName
())
.
name
(
learningContent
.
getName
())
.
name
(
learningContent
.
getName
())
...
@@ -150,12 +158,32 @@ public class LearningContentController extends BaseController {
...
@@ -150,12 +158,32 @@ public class LearningContentController extends BaseController {
.
build
();
.
build
();
this
.
auditService
.
save
(
audit
);
this
.
auditService
.
save
(
audit
);
return
getSuccessResult
();
return
getSuccessResult
();
}
else
if
(
result
)
{
return
getSuccessResult
();
}
else
{
}
else
{
// 保存失败
// 保存失败
return
getFailResult
();
return
getFailResult
();
}
}
}
}
/**
* 判断是否为单位管理员
*
* @param tUser
* @return
*/
private
boolean
isUnitRole
(
TUser
tUser
)
{
boolean
result
=
false
;
if
(
tUser
!=
null
)
{
List
<
String
>
roleList
=
tUser
.
getRoleList
();
if
(!
CollectionUtils
.
isEmpty
(
roleList
))
{
//单位管理员角色id为2
result
=
roleList
.
contains
(
"2"
);
}
}
return
result
;
}
@PutMapping
(
"/update"
)
@PutMapping
(
"/update"
)
@RequiresAuthentication
//@RequiresPermissions("learning:content:update")
@RequiresAuthentication
//@RequiresPermissions("learning:content:update")
@ApiOperation
(
value
=
"修改学习内容信息"
,
notes
=
"修改学习内容信息"
)
@ApiOperation
(
value
=
"修改学习内容信息"
,
notes
=
"修改学习内容信息"
)
...
...
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