|
@@ -11,15 +11,21 @@ import cn.com.qmth.examcloud.core.print.common.jpa.SearchBuilder;
|
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.SpecUtils;
|
|
|
import cn.com.qmth.examcloud.core.print.common.utils.Check;
|
|
|
import cn.com.qmth.examcloud.core.print.entity.CoursePaper;
|
|
|
+import cn.com.qmth.examcloud.core.print.entity.CourseStatistic;
|
|
|
import cn.com.qmth.examcloud.core.print.repository.CoursePaperRepository;
|
|
|
+import cn.com.qmth.examcloud.core.print.repository.CourseStatisticRepository;
|
|
|
import cn.com.qmth.examcloud.core.print.service.CoursePaperService;
|
|
|
-import cn.com.qmth.examcloud.core.print.service.bean.coursepaper.*;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.coursepaper.CoursePaperConvert;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.coursepaper.CoursePaperInfo;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.coursepaper.CoursePaperQuery;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.coursepaper.CoursePaperTotalInfo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.util.List;
|
|
@@ -33,6 +39,8 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
private static final Logger log = LoggerFactory.getLogger(CoursePaperServiceImpl.class);
|
|
|
@Autowired
|
|
|
private CoursePaperRepository coursePaperRepository;
|
|
|
+ @Autowired
|
|
|
+ private CourseStatisticRepository courseStatisticRepository;
|
|
|
|
|
|
@Override
|
|
|
public List<CoursePaperInfo> getCoursePaperList(CoursePaperQuery query) {
|
|
@@ -63,36 +71,51 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
|
|
|
@Override
|
|
|
public File downloadPaperStructure(Long examId, Long paperId) {
|
|
|
+ //todo
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void checkPaperStructure(Long examId, Long paperId) {
|
|
|
-
|
|
|
+ //todo
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void allotCoursePaper(CoursePaperForm form) {
|
|
|
-
|
|
|
+ @Transactional
|
|
|
+ public void allotCoursePaper(Long courseStatisticId, Long coursePaperId) {
|
|
|
+ Check.isEmpty(courseStatisticId, "课程统计ID不能为空!");
|
|
|
+ Check.isEmpty(coursePaperId, "课程试卷ID不能为空!");
|
|
|
+ CourseStatistic statistic = courseStatisticRepository.findOne(courseStatisticId);
|
|
|
+ if (statistic == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ CoursePaper coursePaper = coursePaperRepository.findOne(coursePaperId);
|
|
|
+ if (coursePaper == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ statistic.setCoursePaper(coursePaper);
|
|
|
+ courseStatisticRepository.save(statistic);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void allotCoursePapers(Long orgId, Long examId) {
|
|
|
-
|
|
|
+ public void allotAllCoursePaper(Long orgId, Long examId) {
|
|
|
+ //todo
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public CoursePaperTotalInfo getPaperTotalByOrgIdAndExamId(Long orgId, Long examId) {
|
|
|
+ //todo
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public File exportAllByOrgIdAndExamId(Long orgId, Long examId) {
|
|
|
+ //todo
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public File exportBatchByIds(Long[] ids) {
|
|
|
+ //todo
|
|
|
return null;
|
|
|
}
|
|
|
|