|
|
@@ -21,6 +21,7 @@ import com.fs.his.service.IFsStorePaymentService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import lombok.Getter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -58,7 +59,8 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
|
|
|
private FsCourseWatchLogMapper courseWatchLogMapper;
|
|
|
@Autowired
|
|
|
private FsUserCourseCategoryMapper courseCategoryMapper;
|
|
|
-
|
|
|
+ @Value("${cloud_host.company_name}")
|
|
|
+ private String signProjectName;
|
|
|
/**
|
|
|
* 查询题库
|
|
|
*
|
|
|
@@ -154,31 +156,58 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
|
|
|
FsCourseAnswerLogs rightLog;
|
|
|
//判断短链类型
|
|
|
|
|
|
- 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();
|
|
|
+ if ("泽林文化".equals(signProjectName)){
|
|
|
+ FsCourseWatchLog log = courseWatchLogMapper.getWatchLogByFsUserAndPeriodId(param.getVideoId(), param.getUserId(), param.getCompanyUserId(),param.getPeriodId());
|
|
|
+ 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("该课程已答题完成,不可重复答题");
|
|
|
+ rightLog = courseAnswerLogsMapper.selectRightLogByCourseVideoAndPeriodId(param.getVideoId(), param.getUserId(), param.getQwUserId(),param.getPeriodId());
|
|
|
+ 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 {
|
|
|
return R.ok("答题成功");
|
|
|
}
|
|
|
- } else {
|
|
|
- return R.ok("答题成功");
|
|
|
}
|
|
|
- }
|
|
|
- errorCount = courseAnswerLogsMapper.selectErrorCountByCourseVideo(param.getVideoId(), param.getUserId(),param.getQwUserId(),log.getProject());
|
|
|
+ errorCount = courseAnswerLogsMapper.selectErrorCountByCourseVideo(param.getVideoId(), param.getUserId(),param.getQwUserId(),log.getProject());
|
|
|
|
|
|
+ }else {
|
|
|
+ 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());
|
|
|
+ if (fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 1) {
|
|
|
+ return R.error("该课程已答题完成,不可重复答题");
|
|
|
+ } else {
|
|
|
+ return R.ok("答题成功");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return R.ok("答题成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ errorCount = courseAnswerLogsMapper.selectErrorCountByCourseVideo(param.getVideoId(), param.getUserId(), param.getQwUserId(), log.getProject());
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if (errorCount >= config.getAnswerErrorCount()) {
|