Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
answer-backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
answer
answer-backend
Commits
22560772
Commit
22560772
authored
Sep 02, 2022
by
jcm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022.9.2
parent
18e92d1b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
28 deletions
+30
-28
user-server/src/main/java/com/zq/user/controller/PrizeController.java
+1
-1
user-server/src/main/java/com/zq/user/service/LotteryInfoService.java
+1
-1
user-server/src/main/java/com/zq/user/service/PrizeService.java
+2
-3
user-server/src/main/java/com/zq/user/service/QuestionService.java
+26
-23
No files found.
user-server/src/main/java/com/zq/user/controller/PrizeController.java
View file @
22560772
...
...
@@ -134,7 +134,7 @@ public class PrizeController {
return
ResultVo
.
success
();
}
// @ApiOperation("获取抽奖记录")
// @ApiOperation("获取抽奖记录")
// @PostMapping(value = "/getLotteryRecList")
// public ResultVo<PageVo<LotteryRec>> getLotteryRecList(@RequestBody LotteryRecFindVo vo) {
// return ResultVo.success(prizeService.getLotteryRecList(vo));
...
...
user-server/src/main/java/com/zq/user/service/LotteryInfoService.java
View file @
22560772
...
...
@@ -204,7 +204,7 @@ public class LotteryInfoService {
/**
* 根据姓名模糊查询活动介绍
*
* @param vo
* @param vo
* @return
*/
public
PageVo
<
LotteryInfoVo
>
getLotteryInfoByLike
(
LotteryInfoVo
vo
)
{
...
...
user-server/src/main/java/com/zq/user/service/PrizeService.java
View file @
22560772
...
...
@@ -126,7 +126,6 @@ PrizeService {
return
prizeDao
.
selectById
(
prizeId
);
}
// todo 抽奖模块尚未修改
public
LotteryRecFindVo
luckDraw
(
String
userId
,
LotteryInfoVo
infoVo
)
{
// List<Prize> prizeList = prizeDao.getLuckDrawPrize();
// 当期活动奖品列表
...
...
@@ -211,8 +210,8 @@ PrizeService {
int
count
=
lotteryRecDao
.
insert
(
build
);
// todo 返回值没想好返回什么
// 返回抽奖记录列表vo
QueryWrapper
<
LotteryRec
>
wrapper
=
new
QueryWrapper
<>();
LotteryRec
rec
=
lotteryRecDao
.
selectOne
(
wrapper
.
eq
(
"user_id"
,
userId
).
eq
(
"lottery_id"
,
infoVo
.
getId
()));
QueryWrapper
<
LotteryRec
>
wrapper
=
new
QueryWrapper
<>();
LotteryRec
rec
=
lotteryRecDao
.
selectOne
(
wrapper
.
eq
(
"user_id"
,
userId
).
eq
(
"lottery_id"
,
infoVo
.
getId
()));
LotteryRecFindVo
lotteryRecFindVo
=
new
LotteryRecFindVo
();
BeanUtil
.
copyProperties
(
rec
,
lotteryRecFindVo
);
...
...
user-server/src/main/java/com/zq/user/service/QuestionService.java
View file @
22560772
...
...
@@ -85,18 +85,21 @@ public class QuestionService {
}
public
void
editQuestion
(
Question
vo
)
{
Question
question
=
questionDao
.
selectById
(
vo
.
getId
());
AssertUtils
.
notNull
(
question
,
"题目不存在"
);
question
.
setSubject
(
vo
.
getSubject
());
question
.
setContent
(
vo
.
getContent
());
question
.
setAnalysis
(
vo
.
getAnalysis
());
question
.
setAnswer
(
vo
.
getAnswer
());
question
.
setQuestionTypeId
(
vo
.
getQuestionTypeId
());
question
.
setLotteryInfoName
(
lotteryInfoDao
.
selectById
(
vo
.
getLotteryId
()).
getLotteryInfoName
());
question
.
setLotteryId
(
vo
.
getLotteryId
());
questionDao
.
updateById
(
question
);
AssertUtils
.
notNull
(
questionDao
.
selectById
(
vo
.
getId
())
==
null
,
"题目不存在"
);
// Question question = questionDao.selectById(vo.getId());
//
// question.setSubject(vo.getSubject());
// question.setContent(vo.getContent());
// question.setAnalysis(vo.getAnalysis());
// question.setAnswer(vo.getAnswer());
// question.setQuestionTypeId(vo.getQuestionTypeId());
// question.setLotteryInfoName(lotteryInfoDao.selectById(vo.getLotteryId()).getLotteryInfoName());
// question.setLotteryId(vo.getLotteryId());
if
(
vo
.
getLotteryId
()
!=
null
)
{
vo
.
setLotteryInfoName
(
lotteryInfoDao
.
selectById
(
vo
.
getLotteryId
()).
getLotteryInfoName
());
vo
.
setLotteryId
(
vo
.
getLotteryId
());
}
questionDao
.
updateById
(
vo
);
}
public
void
delQuestion
(
Set
<
String
>
ids
)
{
...
...
@@ -104,11 +107,11 @@ public class QuestionService {
}
public
Question
getQuestion
(
String
questionId
)
{
Question
question
=
questionDao
.
selectById
(
questionId
);
if
(
question
.
getQuestionTypeId
()
!=
null
)
{
QuestionType
questionType
=
questionTypeDao
.
selectById
(
question
.
getQuestionTypeId
());
question
.
setQuestionTypeName
(
questionType
.
getName
());
}
Question
question
=
questionDao
.
selectById
(
questionId
);
if
(
question
.
getQuestionTypeId
()
!=
null
)
{
QuestionType
questionType
=
questionTypeDao
.
selectById
(
question
.
getQuestionTypeId
());
question
.
setQuestionTypeName
(
questionType
.
getName
());
}
return
question
;
}
...
...
@@ -142,12 +145,12 @@ public class QuestionService {
// 删除所选答案,正确答案中还有答案就说明答错了
boolean
remove
=
answerList
.
remove
(
s
);
if
(!
remove
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"subject"
,
question
.
getSubject
());
map
.
put
(
"answer"
,
question
.
getAnswer
());
map
.
put
(
"analysis"
,
question
.
getAnalysis
());
map
.
put
(
"content"
,
question
.
getContent
());
map
.
put
(
"choiceAnswer"
,
answer
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"subject"
,
question
.
getSubject
());
map
.
put
(
"answer"
,
question
.
getAnswer
());
map
.
put
(
"analysis"
,
question
.
getAnalysis
());
map
.
put
(
"content"
,
question
.
getContent
());
map
.
put
(
"choiceAnswer"
,
answer
);
wrongQuestionList
.
add
(
map
);
break
;
...
...
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