|
@@ -1,7 +1,17 @@
|
|
package com.qmth.teachcloud.report.business.service.impl;
|
|
package com.qmth.teachcloud.report.business.service.impl;
|
|
|
|
|
|
-import com.qmth.teachcloud.report.business.service.AnalyzeDataCheckService;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
|
+import com.qmth.teachcloud.report.business.entity.TBPaper;
|
|
|
|
+import com.qmth.teachcloud.report.business.entity.TBPaperStruct;
|
|
|
|
+import com.qmth.teachcloud.report.business.service.*;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
@@ -10,8 +20,63 @@ import org.springframework.stereotype.Service;
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
public class AnalyzeDataCheckServiceImpl implements AnalyzeDataCheckService {
|
|
public class AnalyzeDataCheckServiceImpl implements AnalyzeDataCheckService {
|
|
|
|
+ @Resource
|
|
|
|
+ private TBExamCourseService tbExamCourseService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TBCommonLevelConfigService tbCommonLevelConfigService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TBCommonRankLevelConfigService tbCommonRankLevelConfigService;
|
|
|
|
+ @Resource
|
|
|
|
+ private AnalyzeForReportService analyzeForReportService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TBPaperService tbPaperService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TBPaperStructService tbPaperStructService;
|
|
|
|
+
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public void checkPaperStructInDimensionDatasource(String knowledgeDimension, String abilityDimension, Long examId, String courseCode) {
|
|
public void checkPaperStructInDimensionDatasource(String knowledgeDimension, String abilityDimension, Long examId, String courseCode) {
|
|
|
|
+ // TODO: 2022/6/9
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ @Override
|
|
|
|
+ public void checkPaperTotal(Long schoolId, Long examId, String courseCode) {
|
|
|
|
+ TBPaper tbPaper = tbPaperService.getOne(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId,examId).eq(TBPaper::getCourseCode,courseCode));
|
|
|
|
+ if (Objects.isNull(tbPaper)){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("未找到试卷");
|
|
|
|
+ }
|
|
|
|
+ Long paperId = tbPaper.getId();
|
|
|
|
+ BigDecimal totalScore = tbPaper.getTotalScore();
|
|
|
|
+
|
|
|
|
+ List<TBPaperStruct> tbPaperStructList = tbPaperStructService.list(new QueryWrapper<TBPaperStruct>().lambda().eq(TBPaperStruct::getPaperId,paperId));
|
|
|
|
+ BigDecimal sum = BigDecimal.ZERO;
|
|
|
|
+ for (TBPaperStruct tbPaperStruct : tbPaperStructList) {
|
|
|
|
+ sum = sum.add(tbPaperStruct.getFullScore());
|
|
|
|
+ }
|
|
|
|
+ if (totalScore.compareTo(sum) != 0){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("试卷总分和试卷结构中各个题目分数之和不一致");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ @Override
|
|
|
|
+ public void checkExamStudentAnswer(Long schoolId, Long examId, String courseCode) {
|
|
|
|
+ // TODO: 2022/6/9
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ @Override
|
|
|
|
+ public void importConfigData(Long schoolId, Long examId, String courseCode) {
|
|
|
|
+ if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("课程编号[" + courseCode + "]的课程分析数据已测试或发布,不能变更基础数据");
|
|
|
|
+ }
|
|
|
|
+ tbCommonLevelConfigService.importLevelConfig(examId, courseCode, null);
|
|
|
|
+ tbCommonRankLevelConfigService.importRankLevelConfig(examId, courseCode, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void triggerAssign(Long schoolId, Long examId, String courseCode) {
|
|
|
|
+ analyzeForReportService.normalAssignScore(examId,schoolId,courseCode);
|
|
}
|
|
}
|
|
}
|
|
}
|