|
@@ -38,6 +38,7 @@ import cn.com.qmth.am.bean.AutoScoreEnRequest;
|
|
import cn.com.qmth.am.bean.ImageSlice;
|
|
import cn.com.qmth.am.bean.ImageSlice;
|
|
import cn.com.qmth.am.bean.StudentScoreImageDto;
|
|
import cn.com.qmth.am.bean.StudentScoreImageDto;
|
|
import cn.com.qmth.am.bean.StudentScoreInfo;
|
|
import cn.com.qmth.am.bean.StudentScoreInfo;
|
|
|
|
+import cn.com.qmth.am.bean.StudentScoreVo;
|
|
import cn.com.qmth.am.bean.ds.AutoScoreResult;
|
|
import cn.com.qmth.am.bean.ds.AutoScoreResult;
|
|
import cn.com.qmth.am.config.SysProperty;
|
|
import cn.com.qmth.am.config.SysProperty;
|
|
import cn.com.qmth.am.dao.local.StudentScoreDao;
|
|
import cn.com.qmth.am.dao.local.StudentScoreDao;
|
|
@@ -71,26 +72,29 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public void saveByQuestion(QuestionEntity q, List<StudentScoreEntity> ss) {
|
|
|
|
- if (q == null) {
|
|
|
|
|
|
+ public void saveByQuestion(List<QuestionEntity> qlist, List<String> examNumbers) {
|
|
|
|
+ if (CollectionUtils.isEmpty(qlist)) {
|
|
throw new StatusException("试题信息为空");
|
|
throw new StatusException("试题信息为空");
|
|
}
|
|
}
|
|
Set<String> allStudent = getAllStudent();
|
|
Set<String> allStudent = getAllStudent();
|
|
|
|
|
|
- BatchSetDataUtil<StudentScoreEntity> bs = new BatchSetDataUtil<StudentScoreEntity>() {
|
|
|
|
|
|
+ BatchSetDataUtil<String> bs = new BatchSetDataUtil<String>() {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- protected void setData(List<StudentScoreEntity> dataList) {
|
|
|
|
|
|
+ protected void setData(List<String> dataList) {
|
|
List<StudentScoreEntity> adds = new ArrayList<>();
|
|
List<StudentScoreEntity> adds = new ArrayList<>();
|
|
- for (StudentScoreEntity stu : dataList) {
|
|
|
|
- String scorekey = q.getId() + "-" + stu.getExamNumber();
|
|
|
|
- if (!allStudent.contains(scorekey)) {
|
|
|
|
- adds.add(stu);
|
|
|
|
- allStudent.add(scorekey);
|
|
|
|
- stu.setQuestionId(q.getId());
|
|
|
|
- stu.setAnswerStatus(DataStatus.WAITING);
|
|
|
|
- stu.setScoreStatus(DataStatus.WAITING);
|
|
|
|
- stu.setExamNumber(stu.getExamNumber());
|
|
|
|
|
|
+ for (String examNumber : dataList) {
|
|
|
|
+ for (QuestionEntity q : qlist) {
|
|
|
|
+ String scorekey = q.getId() + "-" + examNumber;
|
|
|
|
+ if (!allStudent.contains(scorekey)) {
|
|
|
|
+ StudentScoreEntity stu = new StudentScoreEntity();
|
|
|
|
+ adds.add(stu);
|
|
|
|
+ allStudent.add(scorekey);
|
|
|
|
+ stu.setQuestionId(q.getId());
|
|
|
|
+ stu.setAnswerStatus(DataStatus.WAITING);
|
|
|
|
+ stu.setScoreStatus(DataStatus.WAITING);
|
|
|
|
+ stu.setExamNumber(examNumber);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (CollectionUtils.isNotEmpty(adds)) {
|
|
if (CollectionUtils.isNotEmpty(adds)) {
|
|
@@ -98,7 +102,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- bs.setDataForBatch(ss, 1000);
|
|
|
|
|
|
+ bs.setDataForBatch(examNumbers, 500);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -624,4 +628,33 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
}
|
|
}
|
|
return r;
|
|
return r;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public StudentScoreEntity findUpdateMarkingScore() {
|
|
|
|
+ QueryWrapper<StudentScoreEntity> wrapper = new QueryWrapper<>();
|
|
|
|
+ LambdaQueryWrapper<StudentScoreEntity> lw = wrapper.lambda();
|
|
|
|
+ lw.isNull(StudentScoreEntity::getMarkingScore);
|
|
|
|
+ wrapper.last("LIMIT 1");
|
|
|
|
+ return this.getOne(wrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Transactional
|
|
|
|
+ @Override
|
|
|
|
+ public void updateMarkingScore(StudentScoreVo score) {
|
|
|
|
+ UpdateWrapper<StudentScoreEntity> wrapper = new UpdateWrapper<>();
|
|
|
|
+ LambdaUpdateWrapper<StudentScoreEntity> lw = wrapper.lambda();
|
|
|
|
+ lw.set(StudentScoreEntity::getMarkingScore, score.getMarkingScore());
|
|
|
|
+ lw.eq(StudentScoreEntity::getId, score.getId());
|
|
|
|
+ this.update(wrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<StudentScoreVo> getInfoByExam(Long examId) {
|
|
|
|
+ return this.baseMapper.getInfoByExam(examId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<StudentScoreVo> getAllInfoForUpdateScore() {
|
|
|
|
+ return this.baseMapper.getAllInfoForUpdateScore();
|
|
|
|
+ }
|
|
}
|
|
}
|