zx hace 5 días
padre
commit
a2ad601acc

+ 7 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsCourseQuestionBankServiceImpl.java

@@ -281,7 +281,13 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
             rightLog = courseAnswerLogsMapper.selectRightLogByCourseVideo(param.getVideoId(), param.getUserId(), param.getQwUserId());
             if (rightLog != null) {
                 if (log.getRewardType() != null) {
-                    return R.error("该课程已答题完成,不可重复答题");
+                    // 增加判断,去查询红包记录是否已发送成功,如果成功,则返回当前提示,否则返回答题成功(让其可以继续答题,直到红包领取完成)
+                    FsCourseRedPacketLog fsCourseRedPacketLog = redPacketLogMapper.selectUserFsCourseRedPacketLog(param.getVideoId(), param.getUserId(),param.getPeriodId());
+                    if(fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 1) {
+                        return R.error("该课程已答题完成,不可重复答题");
+                    } else {
+                        return R.ok("答题成功");
+                    }
                 } else {
                     return R.ok("答题成功");
                 }