| | |
| | | package com.ycl.jxkg.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | Meet vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | if(vo.getStatus().equals(MeetStatusEnum.Starting.getCode())){ |
| | | //增加学生上课记录 |
| | | Integer userId = webContext.getCurrentUser().getId(); |
| | | //验证有没有重复进入(重复进入会导致上课次数增多) |
| | | QueryWrapper<MeetStudent> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("meet_id",id); |
| | | queryWrapper.eq("student_id",userId); |
| | | queryWrapper.eq("version",vo.getUpdateVersion()); |
| | | MeetStudent one = meetStudentMapper.selectOne(queryWrapper); |
| | | if(one != null){ |
| | | return Result.ok(); |
| | | } |
| | | //增加学生上课记录 |
| | | MeetStudent meetStudent = new MeetStudent(); |
| | | meetStudent.setMeetId(id); |
| | | meetStudent.setStudentId(userId); |
| | | meetStudent.setCreateTime(new Date()); |
| | | meetStudent.setStartTime(vo.getStartTime()); |
| | | meetStudent.setVersion(vo.getUpdateVersion()); |
| | | meetStudent.setMeetName(vo.getMeetName()); |
| | | //TODO:暂时处理,后期考虑jitsiApi |
| | | meetStudent.setDuringTime((vo.getEndTime().getTime()-new Date().getTime())/1000); |
| | | meetStudent.setDuringTime(0L); |
| | | meetStudentMapper.insert(meetStudent); |
| | | //学生学习档案更新 |
| | | StudyRecord studyRecord = studyRecordMapper.getByStudentId(userId); |