|
@@ -166,49 +166,32 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
|
|
new FsCourseAnswerLogs();
|
|
new FsCourseAnswerLogs();
|
|
FsCourseAnswerLogs rightLog;
|
|
FsCourseAnswerLogs rightLog;
|
|
//判断短链类型
|
|
//判断短链类型
|
|
- if (param.getLinkType()!=null&¶m.getLinkType()==1){
|
|
|
|
- rightLog = courseAnswerLogsMapper.selectRightLogByCourseVideo(param.getVideoId(), param.getUserId(),null);
|
|
|
|
- if (rightLog!=null){
|
|
|
|
|
|
+
|
|
|
|
+ FsCourseWatchLog log = courseWatchLogMapper.getWatchLogByFsUser(param.getVideoId(), param.getUserId(), param.getCompanyUserId());
|
|
|
|
+ if (log==null){
|
|
|
|
+ return R.error("无记录");
|
|
|
|
+ }
|
|
|
|
+ if (log.getLogType()!=2){
|
|
|
|
+ return R.error("未完课");
|
|
|
|
+ }
|
|
|
|
+ logId = log.getLogId();
|
|
|
|
+
|
|
|
|
+ rightLog = courseAnswerLogsMapper.selectRightLogByCourseVideo(param.getVideoId(), param.getUserId(), param.getQwUserId());
|
|
|
|
+ if (rightLog != null) {
|
|
|
|
+ if (log.getRewardType() != null) {
|
|
// 增加判断,去查询红包记录是否已发送成功,如果成功,则返回当前提示,否则返回答题成功(让其可以继续答题,直到红包领取完成)
|
|
// 增加判断,去查询红包记录是否已发送成功,如果成功,则返回当前提示,否则返回答题成功(让其可以继续答题,直到红包领取完成)
|
|
FsCourseRedPacketLog fsCourseRedPacketLog = redPacketLogMapper.selectUserFsCourseRedPacketLog(param.getVideoId(), param.getUserId(),param.getPeriodId());
|
|
FsCourseRedPacketLog fsCourseRedPacketLog = redPacketLogMapper.selectUserFsCourseRedPacketLog(param.getVideoId(), param.getUserId(),param.getPeriodId());
|
|
- if(fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 1){
|
|
|
|
|
|
+ if(fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 1) {
|
|
return R.error("该课程已答题完成,不可重复答题");
|
|
return R.error("该课程已答题完成,不可重复答题");
|
|
- }
|
|
|
|
- }
|
|
|
|
- errorCount = courseAnswerLogsMapper.selectErrorCountByCourseVideo(param.getVideoId(), param.getUserId(),null);
|
|
|
|
-
|
|
|
|
- }else {
|
|
|
|
- FsCourseWatchLog log;
|
|
|
|
- if(isH5User){
|
|
|
|
- log = courseWatchLogMapper.getWatchLogByFsUser(param.getVideoId(), param.getUserId(), param.getCompanyUserId());
|
|
|
|
- } else {
|
|
|
|
- log = courseWatchLogMapper.getWatchCourseVideo(param.getUserId(), param.getVideoId(), param.getQwUserId(), param.getQwExternalId());
|
|
|
|
- }
|
|
|
|
- if (log==null){
|
|
|
|
- return R.error("无记录");
|
|
|
|
- }
|
|
|
|
- if (log.getLogType()!=2){
|
|
|
|
- return R.error("未完课");
|
|
|
|
- }
|
|
|
|
- logId = log.getLogId();
|
|
|
|
-
|
|
|
|
- rightLog = courseAnswerLogsMapper.selectRightLogByCourseVideo(param.getVideoId(), param.getUserId(), param.getQwUserId());
|
|
|
|
- if (rightLog != null) {
|
|
|
|
- if (log.getRewardType() != null) {
|
|
|
|
- // 增加判断,去查询红包记录是否已发送成功,如果成功,则返回当前提示,否则返回答题成功(让其可以继续答题,直到红包领取完成)
|
|
|
|
- FsCourseRedPacketLog fsCourseRedPacketLog = redPacketLogMapper.selectUserFsCourseRedPacketLog(param.getVideoId(), param.getUserId(),param.getPeriodId());
|
|
|
|
- if(fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 1) {
|
|
|
|
- return R.error("该课程已答题完成,不可重复答题");
|
|
|
|
- } else {
|
|
|
|
- return R.ok("答题成功");
|
|
|
|
- }
|
|
|
|
} else {
|
|
} else {
|
|
return R.ok("答题成功");
|
|
return R.ok("答题成功");
|
|
}
|
|
}
|
|
-// return R.error("该课程已答题完成,不可重复答题");
|
|
|
|
|
|
+ } else {
|
|
|
|
+ return R.ok("答题成功");
|
|
}
|
|
}
|
|
- errorCount = courseAnswerLogsMapper.selectErrorCountByCourseVideo(param.getVideoId(), param.getUserId(),param.getQwUserId());
|
|
|
|
}
|
|
}
|
|
|
|
+ errorCount = courseAnswerLogsMapper.selectErrorCountByCourseVideo(param.getVideoId(), param.getUserId(),param.getQwUserId());
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
if (errorCount >= config.getAnswerErrorCount()) {
|
|
if (errorCount >= config.getAnswerErrorCount()) {
|