|
@@ -1,27 +1,31 @@
|
|
|
package com.qmth.teachcloud.mark.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.teachcloud.common.entity.BasicExam;
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.enums.ScanStatus;
|
|
|
import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
|
|
|
import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamInfoVo;
|
|
|
+import com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto;
|
|
|
+import com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailFilterDto;
|
|
|
import com.qmth.teachcloud.mark.entity.MarkStudent;
|
|
|
import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
|
|
|
import com.qmth.teachcloud.mark.service.MarkPaperService;
|
|
|
import com.qmth.teachcloud.mark.service.MarkStudentService;
|
|
|
import com.qmth.teachcloud.mark.service.ScanPackageService;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -33,11 +37,11 @@ import com.qmth.teachcloud.mark.service.ScanPackageService;
|
|
|
*/
|
|
|
@Service
|
|
|
public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkStudent> implements MarkStudentService {
|
|
|
- @Autowired
|
|
|
- private MarkPaperService markPaperService;
|
|
|
- @Autowired
|
|
|
- private ScanPackageService scanPackageService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private MarkPaperService markPaperService;
|
|
|
+ @Autowired
|
|
|
+ private ScanPackageService scanPackageService;
|
|
|
+
|
|
|
@Override
|
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
|
QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
|
|
@@ -62,25 +66,35 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
this.update(updateWrapper);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public ScanExamInfoVo getScanExamInfo(BasicExam exam) {
|
|
|
- ScanExamInfoVo vo=new ScanExamInfoVo();
|
|
|
- vo.setId(exam.getId());
|
|
|
- vo.setName(exam.getName());
|
|
|
- vo.getAnswerScan().setCourseCount(markPaperService.getCountByExam(exam.getId()));
|
|
|
- vo.getAnswerScan().setTotalCount(getCount(exam.getId(), null));
|
|
|
- vo.getAnswerScan().setScannedCount(getCount(exam.getId(), ScanStatus.SCANNED));
|
|
|
- vo.getPackageScan().setScannedCount(scanPackageService.getCount(exam.getId()));
|
|
|
- return vo;
|
|
|
- }
|
|
|
-
|
|
|
- private int getCount(Long examId,ScanStatus status) {
|
|
|
- QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
|
|
|
+ @Override
|
|
|
+ public ScanExamInfoVo getScanExamInfo(BasicExam exam) {
|
|
|
+ ScanExamInfoVo vo = new ScanExamInfoVo();
|
|
|
+ vo.setId(exam.getId());
|
|
|
+ vo.setName(exam.getName());
|
|
|
+ vo.getAnswerScan().setCourseCount(markPaperService.getCountByExam(exam.getId()));
|
|
|
+ vo.getAnswerScan().setTotalCount(getCount(exam.getId(), null));
|
|
|
+ vo.getAnswerScan().setScannedCount(getCount(exam.getId(), ScanStatus.SCANNED));
|
|
|
+ vo.getPackageScan().setScannedCount(scanPackageService.getCount(exam.getId()));
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public IPage<StudentScoreDetailDto> pageStudentScore(Long examId, String paperNumber, String college, String className, String teacher, Integer filter, Boolean absent, Boolean breach, Double startScore, Double endScore, Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode, Integer pageNumber, Integer pageSize) {
|
|
|
+ if (startScore != null && endScore == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("请输入结束分数值");
|
|
|
+ }
|
|
|
+ Page<StudentScoreDetailDto> page = new Page<>(pageNumber, pageSize);
|
|
|
+ StudentScoreDetailFilterDto studentScoreDetailFilterDto = new StudentScoreDetailFilterDto();
|
|
|
+ return this.baseMapper.pageStudentScore(page, examId, paperNumber, college, className, teacher, studentScoreDetailFilterDto, absent, breach, startScore, endScore, subScore, objectiveScoreRateLt, studentName, studentCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ private int getCount(Long examId, ScanStatus status) {
|
|
|
+ QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
|
|
|
LambdaQueryWrapper<MarkStudent> lw = wrapper.lambda();
|
|
|
lw.eq(MarkStudent::getExamId, examId);
|
|
|
- if(status!=null) {
|
|
|
- lw.eq(MarkStudent::getScanStatus, status);
|
|
|
+ if (status != null) {
|
|
|
+ lw.eq(MarkStudent::getScanStatus, status);
|
|
|
}
|
|
|
return baseMapper.selectCount(wrapper);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|