Commit 22560772 by jcm

2022.9.2

parent 18e92d1b
...@@ -134,7 +134,7 @@ public class PrizeController { ...@@ -134,7 +134,7 @@ public class PrizeController {
return ResultVo.success(); return ResultVo.success();
} }
// @ApiOperation("获取抽奖记录") // @ApiOperation("获取抽奖记录")
// @PostMapping(value = "/getLotteryRecList") // @PostMapping(value = "/getLotteryRecList")
// public ResultVo<PageVo<LotteryRec>> getLotteryRecList(@RequestBody LotteryRecFindVo vo) { // public ResultVo<PageVo<LotteryRec>> getLotteryRecList(@RequestBody LotteryRecFindVo vo) {
// return ResultVo.success(prizeService.getLotteryRecList(vo)); // return ResultVo.success(prizeService.getLotteryRecList(vo));
......
...@@ -204,7 +204,7 @@ public class LotteryInfoService { ...@@ -204,7 +204,7 @@ public class LotteryInfoService {
/** /**
* 根据姓名模糊查询活动介绍 * 根据姓名模糊查询活动介绍
* *
* @param vo * @param vo
* @return * @return
*/ */
public PageVo<LotteryInfoVo> getLotteryInfoByLike(LotteryInfoVo vo) { public PageVo<LotteryInfoVo> getLotteryInfoByLike(LotteryInfoVo vo) {
......
...@@ -126,7 +126,6 @@ PrizeService { ...@@ -126,7 +126,6 @@ PrizeService {
return prizeDao.selectById(prizeId); return prizeDao.selectById(prizeId);
} }
// todo 抽奖模块尚未修改
public LotteryRecFindVo luckDraw(String userId, LotteryInfoVo infoVo) { public LotteryRecFindVo luckDraw(String userId, LotteryInfoVo infoVo) {
// List<Prize> prizeList = prizeDao.getLuckDrawPrize(); // List<Prize> prizeList = prizeDao.getLuckDrawPrize();
// 当期活动奖品列表 // 当期活动奖品列表
...@@ -211,8 +210,8 @@ PrizeService { ...@@ -211,8 +210,8 @@ PrizeService {
int count = lotteryRecDao.insert(build); int count = lotteryRecDao.insert(build);
// todo 返回值没想好返回什么 // todo 返回值没想好返回什么
// 返回抽奖记录列表vo // 返回抽奖记录列表vo
QueryWrapper<LotteryRec> wrapper = new QueryWrapper<>(); QueryWrapper<LotteryRec> wrapper = new QueryWrapper<>();
LotteryRec rec = lotteryRecDao.selectOne(wrapper.eq("user_id", userId).eq("lottery_id", infoVo.getId())); LotteryRec rec = lotteryRecDao.selectOne(wrapper.eq("user_id", userId).eq("lottery_id", infoVo.getId()));
LotteryRecFindVo lotteryRecFindVo = new LotteryRecFindVo(); LotteryRecFindVo lotteryRecFindVo = new LotteryRecFindVo();
BeanUtil.copyProperties(rec, lotteryRecFindVo); BeanUtil.copyProperties(rec, lotteryRecFindVo);
......
...@@ -85,18 +85,21 @@ public class QuestionService { ...@@ -85,18 +85,21 @@ public class QuestionService {
} }
public void editQuestion(Question vo) { public void editQuestion(Question vo) {
Question question = questionDao.selectById(vo.getId()); AssertUtils.notNull(questionDao.selectById(vo.getId()) == null, "题目不存在");
AssertUtils.notNull(question, "题目不存在"); // Question question = questionDao.selectById(vo.getId());
//
question.setSubject(vo.getSubject()); // question.setSubject(vo.getSubject());
question.setContent(vo.getContent()); // question.setContent(vo.getContent());
question.setAnalysis(vo.getAnalysis()); // question.setAnalysis(vo.getAnalysis());
question.setAnswer(vo.getAnswer()); // question.setAnswer(vo.getAnswer());
question.setQuestionTypeId(vo.getQuestionTypeId()); // question.setQuestionTypeId(vo.getQuestionTypeId());
question.setLotteryInfoName(lotteryInfoDao.selectById(vo.getLotteryId()).getLotteryInfoName()); // question.setLotteryInfoName(lotteryInfoDao.selectById(vo.getLotteryId()).getLotteryInfoName());
question.setLotteryId(vo.getLotteryId()); // question.setLotteryId(vo.getLotteryId());
questionDao.updateById(question); if (vo.getLotteryId() != null) {
vo.setLotteryInfoName(lotteryInfoDao.selectById(vo.getLotteryId()).getLotteryInfoName());
vo.setLotteryId(vo.getLotteryId());
}
questionDao.updateById(vo);
} }
public void delQuestion(Set<String> ids) { public void delQuestion(Set<String> ids) {
...@@ -104,11 +107,11 @@ public class QuestionService { ...@@ -104,11 +107,11 @@ public class QuestionService {
} }
public Question getQuestion(String questionId) { public Question getQuestion(String questionId) {
Question question = questionDao.selectById(questionId); Question question = questionDao.selectById(questionId);
if (question.getQuestionTypeId() != null) { if (question.getQuestionTypeId() != null) {
QuestionType questionType = questionTypeDao.selectById(question.getQuestionTypeId()); QuestionType questionType = questionTypeDao.selectById(question.getQuestionTypeId());
question.setQuestionTypeName(questionType.getName()); question.setQuestionTypeName(questionType.getName());
} }
return question; return question;
} }
...@@ -142,12 +145,12 @@ public class QuestionService { ...@@ -142,12 +145,12 @@ public class QuestionService {
// 删除所选答案,正确答案中还有答案就说明答错了 // 删除所选答案,正确答案中还有答案就说明答错了
boolean remove = answerList.remove(s); boolean remove = answerList.remove(s);
if (!remove) { if (!remove) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("subject", question.getSubject()); map.put("subject", question.getSubject());
map.put("answer", question.getAnswer()); map.put("answer", question.getAnswer());
map.put("analysis", question.getAnalysis()); map.put("analysis", question.getAnalysis());
map.put("content", question.getContent()); map.put("content", question.getContent());
map.put("choiceAnswer", answer); map.put("choiceAnswer", answer);
wrongQuestionList.add(map); wrongQuestionList.add(map);
break; 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