|
|
|
@ -13,6 +13,7 @@ import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonReturnCode;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseQuestionLogWrongDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.FileEntity;
|
|
|
|
|
import com.ibeetl.jlw.entity.Student;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLogWrong;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogWrongQuery;
|
|
|
|
@ -26,6 +27,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
import org.beetl.sql.core.SqlId;
|
|
|
|
|
import org.beetl.sql.core.engine.PageQuery;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
@ -36,6 +38,7 @@ import java.math.BigDecimal;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getStudent;
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
|
|
|
|
|
import static java.util.stream.Collectors.joining;
|
|
|
|
|
|
|
|
|
@ -48,9 +51,12 @@ import static java.util.stream.Collectors.joining;
|
|
|
|
|
@Transactional
|
|
|
|
|
@Validated
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Deprecated
|
|
|
|
|
public class TeacherOpenCourseQuestionLogWrongService extends CoreBaseService<TeacherOpenCourseQuestionLogWrong> implements DeleteResourcesBy{
|
|
|
|
|
|
|
|
|
|
@Autowired private TeacherOpenCourseQuestionLogWrongDao teacherOpenCourseQuestionLogWrongDao;
|
|
|
|
|
@Autowired @Lazy
|
|
|
|
|
private TeacherOpenCourseQuestionLogService teacherOpenCourseQuestionLogService;
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseQuestionLogWrong>queryByCondition(PageQuery query){
|
|
|
|
|
PageQuery ret = teacherOpenCourseQuestionLogWrongDao.queryByCondition(query);
|
|
|
|
@ -83,6 +89,33 @@ public class TeacherOpenCourseQuestionLogWrongService extends CoreBaseService<Te
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据当前登录的学生身份,修改日志中的错题标记
|
|
|
|
|
* @param ids
|
|
|
|
|
*/
|
|
|
|
|
public void deleteTeacherOpenCourseQuestionLogWrongWithStudent(String ids) {
|
|
|
|
|
|
|
|
|
|
deleteTeacherOpenCourseQuestionLogWrong(ids);
|
|
|
|
|
Student student = getStudent();
|
|
|
|
|
|
|
|
|
|
// 不是学生身份,不操作做题日志数据
|
|
|
|
|
if (student != null) {
|
|
|
|
|
List<TeacherOpenCourseQuestionLogWrong> logWrongList = teacherOpenCourseQuestionLogWrongDao.selectByIds(Arrays.asList(ids.split(",")));
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> questionLogList = teacherOpenCourseQuestionLogService.getQuestionLogByLogWrongList(logWrongList, student.getStudentId());
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(questionLogList)) {
|
|
|
|
|
// 修改做题日志的错题状态
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> updateLogPOList = questionLogList.stream().map(item -> {
|
|
|
|
|
TeacherOpenCourseQuestionLog questionLog = new TeacherOpenCourseQuestionLog();
|
|
|
|
|
questionLog.setTeacherOpenCourseQuestionLogId(item.getTeacherOpenCourseQuestionLogId());
|
|
|
|
|
questionLog.setIsErrorFavorite(false);
|
|
|
|
|
return questionLog;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
teacherOpenCourseQuestionLogService.upsertBatchByTemplate(updateLogPOList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据题目配置ID 批量真删除
|
|
|
|
|
* @param settingIds
|
|
|
|
|