|
@@ -1,19 +1,27 @@
|
|
package com.qmth.teachcloud.mark.service.impl;
|
|
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.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.qmth.teachcloud.mark.entity.MarkStudent;
|
|
|
|
|
|
+import com.qmth.teachcloud.common.entity.BasicExam;
|
|
|
|
+import com.qmth.teachcloud.common.enums.ScanStatus;
|
|
import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
|
|
import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
|
|
|
|
+import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamInfoVo;
|
|
|
|
+import com.qmth.teachcloud.mark.entity.MarkStudent;
|
|
import com.qmth.teachcloud.mark.mapper.MarkStudentMapper;
|
|
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.MarkStudentService;
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
-
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
+import com.qmth.teachcloud.mark.service.ScanPackageService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -25,7 +33,11 @@ import java.util.stream.Collectors;
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkStudent> implements MarkStudentService {
|
|
public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkStudent> implements MarkStudentService {
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private MarkPaperService markPaperService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ScanPackageService scanPackageService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
|
|
@@ -49,4 +61,26 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
.eq(MarkStudent::getId, studentId);
|
|
.eq(MarkStudent::getId, studentId);
|
|
this.update(updateWrapper);
|
|
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<>();
|
|
|
|
+ LambdaQueryWrapper<MarkStudent> lw = wrapper.lambda();
|
|
|
|
+ lw.eq(MarkStudent::getExamId, examId);
|
|
|
|
+ if(status!=null) {
|
|
|
|
+ lw.eq(MarkStudent::getScanStatus, status);
|
|
|
|
+ }
|
|
|
|
+ return baseMapper.selectCount(wrapper);
|
|
|
|
+ }
|
|
}
|
|
}
|