|
@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.distributed.print.business.bean.params.analyze.AbleAnalyzePaperParam;
|
|
|
import com.qmth.distributed.print.business.bean.params.analyze.GradeBatchPaperParam;
|
|
|
import com.qmth.distributed.print.business.bean.result.analyze.GradeBatchPaperResult;
|
|
|
+import com.qmth.distributed.print.business.entity.GradeBatch;
|
|
|
import com.qmth.distributed.print.business.entity.GradeBatchPaper;
|
|
|
import com.qmth.distributed.print.business.enums.GradeAnalyzePaperStatusEnum;
|
|
|
import com.qmth.distributed.print.business.mapper.GradeBatchPaperMapper;
|
|
|
import com.qmth.distributed.print.business.service.GradeBatchPaperService;
|
|
|
+import com.qmth.distributed.print.business.service.GradeBatchService;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
@@ -41,11 +43,13 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
|
|
|
SysOrgService sysOrgService;
|
|
|
@Resource
|
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
|
+ @Resource
|
|
|
+ GradeBatchService gradeBatchService;
|
|
|
|
|
|
@Override
|
|
|
- public IPage<GradeBatchPaperResult> findGradeBatchPaperPage(Long semesterId, Long examId, String courseCode, int pageNumber, int pageSize, SysUser requestUser) {
|
|
|
+ public IPage<GradeBatchPaperResult> findGradeBatchPaperPage(Long batchId, Long examId, String courseCode, int pageNumber, int pageSize, SysUser requestUser) {
|
|
|
Long schoolId = requestUser.getSchoolId();
|
|
|
- IPage<GradeBatchPaperResult> datasource = this.baseMapper.findGradeBatchPaperPage(new Page<>(pageNumber, pageSize), semesterId, examId, courseCode, schoolId);
|
|
|
+ IPage<GradeBatchPaperResult> datasource = this.baseMapper.findGradeBatchPaperPage(new Page<>(pageNumber, pageSize), batchId, examId, courseCode, schoolId);
|
|
|
for (GradeBatchPaperResult record : datasource.getRecords()) {
|
|
|
Long teachingRoomId = record.getTeachingRoomId();
|
|
|
SysOrg teachCollege = this.findTeachCollegeByOrgId(teachingRoomId);
|
|
@@ -56,10 +60,14 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<GradeBatchPaperResult> findAbleAnalyzePaperList(Long semesterId, Long examId, Long collegeId, String courseCode, String teacherName, SysUser requestUser) {
|
|
|
+ public List<GradeBatchPaperResult> findAbleAnalyzePaperList(Long batchId, Long examId, Long collegeId, String courseCode, String teacherName, SysUser requestUser) {
|
|
|
Long schoolId = requestUser.getSchoolId();
|
|
|
Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
|
|
|
- List<GradeBatchPaperResult> datasource = this.baseMapper.findAbleAnalyzePaper(semesterId, examId, collegeId, courseCode, teacherName, orgIds, schoolId);
|
|
|
+ GradeBatch gradeBatch = gradeBatchService.getById(batchId);
|
|
|
+ if (Objects.isNull(gradeBatch)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("教研分析批次不存在");
|
|
|
+ }
|
|
|
+ List<GradeBatchPaperResult> datasource = this.baseMapper.findAbleAnalyzePaper(gradeBatch.getSemesterId(), examId, collegeId, courseCode, teacherName, orgIds, schoolId);
|
|
|
List<GradeBatchPaperResult> needAddList = new ArrayList<>();
|
|
|
for (GradeBatchPaperResult gradeBatchPaperResult : datasource) {
|
|
|
// 额外处理开课学院
|
|
@@ -77,6 +85,7 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
|
|
|
GradeBatchPaperResult needAdd = new GradeBatchPaperResult();
|
|
|
BeanUtils.copyProperties(gradeBatchPaperResult, needAdd);
|
|
|
needAdd.setPaperType(paperTypeCell);
|
|
|
+ needAdd.setPaperName(needAdd.getCourseName() + "-" + paperType);
|
|
|
needAddList.add(needAdd);
|
|
|
}
|
|
|
}
|
|
@@ -129,6 +138,8 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
|
|
|
if (!teachCollegeId.equals(dbBatchPaper.getTeachCollegeId()) || !teachCollegeName.equals(dbBatchPaper.getTeachCollegeName()) || !paperName.equals(dbBatchPaper.getPaperName())) {
|
|
|
gradeBatchPaper.setStatus(GradeAnalyzePaperStatusEnum.PUSH_GRADE_BATCH);
|
|
|
}
|
|
|
+ gradeBatchPaper.setId(dbBatchPaper.getId());
|
|
|
+ gradeBatchPaper.setStatus(dbBatchPaper.getStatus());
|
|
|
gradeBatchPaper.updateInfo(requestUser.getId());
|
|
|
}
|
|
|
return Stream.of(gradeBatchPaper);
|