|
@@ -63,7 +63,7 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
private String QUESTION_URL_PREFIX;//题库访问地址前缀
|
|
|
|
|
|
@Override
|
|
|
- public List<CoursePaperInfo> getCoursePaperList(CoursePaperQuery query) {
|
|
|
+ public List<CoursePaperLessInfo> getCoursePaperList(CoursePaperQuery query) {
|
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
|
Check.isNull(query.getOrgId(), "学校ID不能为空!");
|
|
|
Check.isNull(query.getExamId(), "考试ID不能为空!");
|
|
@@ -127,7 +127,7 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
throw new StatusException(PRT_CODE_400, "试卷页数不能为空!");
|
|
|
}
|
|
|
|
|
|
- CoursePaper oldCoursePaper = coursePaperRepository.findByExamIdAndPaperId(coursePaper.getExamId(), coursePaper.getPaperId());
|
|
|
+ CoursePaper oldCoursePaper = coursePaperRepository.findByPaperId(coursePaper.getPaperId());
|
|
|
if (oldCoursePaper != null) {
|
|
|
//存在则修改
|
|
|
oldCoursePaper.setPaperName(coursePaper.getPaperName());
|
|
@@ -195,11 +195,12 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * (整体)分配待指定试卷
|
|
|
* 选定学校和考试后,为该考试下的所有待分配课程随机分配试卷
|
|
|
* 当题库传输过来的试卷数量不足时,会提示试卷数不足的课程名称(代码)
|
|
|
* 当题库传输过来的试卷数量≥需求时,每种试卷类型随机分配
|
|
|
- * 随机分配后的“课程代码+类型”其试卷状态变为"已有"
|
|
|
- * 试卷状态:已有、无、待指定三种,显示为“待指定”时,点击时弹出试卷制定框
|
|
|
+ * 随机分配后的“课程代码 + 类型”其试卷状态变为"已有"
|
|
|
+ * 试卷状态:已有、无、未指定三种,显示为“未指定”时,点击时弹出试卷制定框
|
|
|
*/
|
|
|
@Override
|
|
|
public void allotAllCoursePaper(Long orgId, Long examId) {
|
|
@@ -212,7 +213,7 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
Specification<CourseStatistic> spec = SpecUtils.buildSearchers(CourseStatistic.class, searches.build());
|
|
|
List<CourseStatistic> statistics = courseStatisticRepository.findAll(spec);
|
|
|
if (statistics == null || statistics.isEmpty()) {
|
|
|
- log.debug("No course paper need to allot.");
|
|
|
+ log.warn("No course paper need to allot.");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -222,7 +223,7 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
//获取考试课程下的试卷列表
|
|
|
List<CoursePaper> coursePapers = this.getCoursePapers(orgId, examId);
|
|
|
|
|
|
- //按课程封装试卷列表
|
|
|
+ //按课程封装试卷列表 Map<courseId, List<CoursePaper>>
|
|
|
Map<Long, List<CoursePaper>> maps = new HashMap<>();
|
|
|
for (CoursePaper coursePaper : coursePapers) {
|
|
|
List<CoursePaper> papers = maps.get(coursePaper.getCourseId());
|
|
@@ -311,9 +312,9 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
Check.isFalse(req.required(), "至少选择一种导出内容!");
|
|
|
|
|
|
SearchBuilder searches = new SearchBuilder();
|
|
|
- searches.eq("paperStatus", PaperStatus.已有.getIndex());
|
|
|
searches.eq("orgId", req.getOrgId());
|
|
|
searches.eq("examId", req.getExamId());
|
|
|
+ searches.eq("paperStatus", PaperStatus.已有.getIndex());
|
|
|
Specification<CourseStatistic> spec = SpecUtils.buildSearchers(CourseStatistic.class, searches.build());
|
|
|
|
|
|
List<CourseStatistic> statistics = courseStatisticRepository.findAll(spec);
|