Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
online-edu
online-edu-backend
Commits
ac0fca55
Commit
ac0fca55
authored
Jul 06, 2021
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug
parent
80730267
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
QAService.java
...ain/java/com/qkdata/biz/management/service/QAService.java
+4
-3
No files found.
src/main/java/com/qkdata/biz/management/service/QAService.java
View file @
ac0fca55
package
com
.
qkdata
.
biz
.
management
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.qkdata.biz.common.BizConstants
;
import
com.qkdata.biz.enums.AnswerTypeEnum
;
import
com.qkdata.biz.enums.QuestionStatusEnum
;
...
...
@@ -74,15 +75,15 @@ public class QAService {
po
.
setQuestionId
(
model
.
getQuestionId
());
po
.
setContent
(
model
.
getContent
());
po
.
setUserId
(
UserContext
.
getUserId
());
boolean
isTeacher
=
SecurityUtils
.
getSubject
().
hasRole
(
BizConstants
.
ROLE_TEACHER
);
if
(
isTeacher
){
boolean
[]
isTeacher
=
SecurityUtils
.
getSubject
().
hasRoles
(
Lists
.
newArrayList
(
BizConstants
.
ROLE_TEACHER
,
BizConstants
.
ROLE_ADMIN
,
BizConstants
.
ROLE_OPERATOR
)
);
if
(
isTeacher
[
0
]
||
isTeacher
[
1
]
||
isTeacher
[
2
]
){
po
.
setType
(
AnswerTypeEnum
.
TEACHER
);
}
else
{
po
.
setType
(
AnswerTypeEnum
.
USER
);
}
answerMapper
.
insert
(
po
);
//修改问题状态
if
(
isTeacher
){
if
(
isTeacher
[
0
]
||
isTeacher
[
1
]
||
isTeacher
[
2
]
){
changeQuestionStatus
(
model
.
getQuestionId
(),
QuestionStatusEnum
.
REPLY
);
}
else
{
changeQuestionStatus
(
model
.
getQuestionId
(),
QuestionStatusEnum
.
WAIT_REPLY
);
...
...
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