Commit 22560772 by jcm

2022.9.2

parent 18e92d1b
......@@ -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));
......
......@@ -204,7 +204,7 @@ public class LotteryInfoService {
/**
* 根据姓名模糊查询活动介绍
*
* @param vo
* @param vo
* @return
*/
public PageVo<LotteryInfoVo> getLotteryInfoByLike(LotteryInfoVo vo) {
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment