无关风月
2024-07-10 c0ab5b660967876fecc88c81498820012c76b035
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/service/impl/TSubjectRecordServiceImpl.java
@@ -5,12 +5,7 @@
import com.ruoyi.study.mapper.TSubjectRecordMapper;
import com.ruoyi.study.service.ITSubjectRecordService;
import com.ruoyi.study.vo.ExitLearnVO;
import com.ruoyi.study.vo.SubjectRecordResultVO;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
 * <p>
@@ -38,13 +33,14 @@
        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(",")));
//        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);
    }