This commit is contained in:
Lx 2025-04-17 09:12:35 +08:00
parent 40148559bf
commit 057a05a8d1

View File

@ -263,8 +263,7 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
schoolNotifyMessageSendService.sendMessage(examBatchVO.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, examBatchVO.getTenantId());
//考试通过
if (process.getSubject() < 3) {
//科目一二插入一条需要查出下一个的学习进度如果不存在手动插入一个
if (process.getSubject() == 3 || process.getSubject() == 2) {
Integer nextSubject = process.getSubject() + 1;
LambdaQueryWrapper<Process> queryWrapper = new LambdaQueryWrapper<Process>()
.eq(Process::getCourseId, process.getCourseId())
@ -272,23 +271,7 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
.eq(Process::getSubject, nextSubject)
.eq(Process::getTenantId,process.getTenantId());
List<Process> list = processService.list(queryWrapper);
if (list.isEmpty()) {
//插入
Process nextProcess = new Process();
nextProcess.setCourseId(process.getCourseId());
nextProcess.setCourseName(process.getCourseName());
nextProcess.setUserId(process.getUserId());
nextProcess.setUserName(process.getUserName());
nextProcess.setUserMobile(process.getUserMobile());
nextProcess.setCoachId(process.getCoachId());
nextProcess.setCoachName(process.getCoachName());
nextProcess.setSubject(process.getSubject() + 1);
nextProcess.setExamNum(process.getExamNum() + 1);
nextProcess.setStatus("1");
nextProcess.setTrainTime((double) 0);
processService.save(nextProcess);
} else {
//更新状态为进行中
if (!list.isEmpty()) {
Process nextProcess = list.get(0);
if(!"2".equals(nextProcess.getStatus())){
nextProcess.setStatus("1");