无关风月
2025-04-11 75942ecc2e438012c5ea876715966ace593565a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.ruoyi.study.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.study.domain.TSubjectRecord;
import com.ruoyi.study.mapper.TSubjectRecordMapper;
import com.ruoyi.study.service.ITSubjectRecordService;
import com.ruoyi.study.vo.ExitLearnVO;
import org.springframework.stereotype.Service;
 
/**
 * <p>
 * 自主游戏 服务实现类
 * </p>
 *
 * @author 无关风月
 * @since 2024-04-26
 */
@Service
public class TSubjectRecordServiceImpl extends ServiceImpl<TSubjectRecordMapper, TSubjectRecord> implements ITSubjectRecordService {
 
    @Override
    public Boolean exitLearning(ExitLearnVO exitLearn, Integer userid) {
        Integer week = exitLearn.getWeek();
        Integer day = exitLearn.getDay();
        Integer type = exitLearn.getType();
        String topicIds = exitLearn.getTopicIds();
        String teamIds = exitLearn.getTeamIds();
        // 封装信息
        TSubjectRecord subjectRecord = new TSubjectRecord();
        subjectRecord.setUserId(userid);
        subjectRecord.setWeek(week);
        subjectRecord.setDay(day);
        subjectRecord.setType(type);
        // 答题次数与答题正确次数
        subjectRecord.setAnswerNumber(exitLearn.getAnswerNumber());
        subjectRecord.setSchedule(exitLearn.getSchedule());
        subjectRecord.setCorrectNumber(exitLearn.getCorrectNumber());
        subjectRecord.setType(type);
        // 题目与题组需处理
//        List<String> teamIdList = Arrays.stream(teamIds.split(",")).collect(Collectors.toList());
//        List<String> topicIdList = Arrays.stream(topicIds.split(",")).collect(Collectors.toList());
//        subjectRecord.setBeforeSubject(teamIdList.stream().map(String::valueOf).collect(Collectors.joining(",")));
//        subjectRecord.setCompleteSubject(topicIdList.stream().map(String::valueOf).collect(Collectors.joining(",")));
        return this.save(subjectRecord);
    }
 
}