|
@@ -24,11 +24,10 @@ import com.qmth.teachcloud.obe.been.report.CourseTargetWebDto;
|
|
import com.qmth.teachcloud.obe.been.result.ObeCourseWeightResult;
|
|
import com.qmth.teachcloud.obe.been.result.ObeCourseWeightResult;
|
|
import com.qmth.teachcloud.obe.been.result.report.PaperStructDimensionResult;
|
|
import com.qmth.teachcloud.obe.been.result.report.PaperStructDimensionResult;
|
|
import com.qmth.teachcloud.obe.entity.ObeCourseOutline;
|
|
import com.qmth.teachcloud.obe.entity.ObeCourseOutline;
|
|
|
|
+import com.qmth.teachcloud.obe.entity.TCFinalScore;
|
|
import com.qmth.teachcloud.obe.entity.TCPaperStruct;
|
|
import com.qmth.teachcloud.obe.entity.TCPaperStruct;
|
|
-import com.qmth.teachcloud.obe.service.ObeCourseOutlineService;
|
|
|
|
-import com.qmth.teachcloud.obe.service.TCFinalScoreService;
|
|
|
|
-import com.qmth.teachcloud.obe.service.TCPaperStructService;
|
|
|
|
-import com.qmth.teachcloud.obe.service.TRBasicInfoService;
|
|
|
|
|
|
+import com.qmth.teachcloud.obe.entity.TCUsualScore;
|
|
|
|
+import com.qmth.teachcloud.obe.service.*;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -81,6 +80,9 @@ public class TCPaperStructController {
|
|
@Resource
|
|
@Resource
|
|
ObeCourseOutlineService obeCourseOutlineService;
|
|
ObeCourseOutlineService obeCourseOutlineService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ TCUsualScoreService tcUsualScoreService;
|
|
|
|
+
|
|
@ApiOperation(value = "导入试卷结构")
|
|
@ApiOperation(value = "导入试卷结构")
|
|
@RequestMapping(value = "/final_score/paper_struct/import", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/final_score/paper_struct/import", method = RequestMethod.POST)
|
|
@OperationLogDetail(operationType = OperationTypeEnum.IMPORT)
|
|
@OperationLogDetail(operationType = OperationTypeEnum.IMPORT)
|
|
@@ -206,11 +208,24 @@ public class TCPaperStructController {
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = null;
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = null;
|
|
TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
if (Objects.isNull(tcPaperStruct) || (Objects.isNull(tcPaperStruct.getPaperStruct()) && Objects.isNull(tcPaperStruct.getPaperStructDimension()))) {
|
|
if (Objects.isNull(tcPaperStruct) || (Objects.isNull(tcPaperStruct.getPaperStruct()) && Objects.isNull(tcPaperStruct.getPaperStructDimension()))) {
|
|
- List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
|
- if (!CollectionUtils.isEmpty(markQuestionList)) {
|
|
|
|
- paperStructDimensionResultList = new ArrayList<>(markQuestionList.size());
|
|
|
|
- for (MarkQuestion markQuestion : markQuestionList) {
|
|
|
|
- paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), examId, markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
|
|
|
|
|
|
+ List<TCFinalScore> tcFinalScoreList = tcFinalScoreService.queryFinalScore(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
+ List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.queryUsualScore(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
+ int tcFinalScoreFilterCount = 0, tcUsualScoreFilterCount = 0;
|
|
|
|
+ if (!CollectionUtils.isEmpty(tcFinalScoreList)) {
|
|
|
|
+ List<TCFinalScore> tcFinalScoreFilterList = tcFinalScoreList.stream().filter(s -> Objects.nonNull(s.getScore())).collect(Collectors.toList());
|
|
|
|
+ tcFinalScoreFilterCount = tcFinalScoreFilterList.size();
|
|
|
|
+ }
|
|
|
|
+ if (!CollectionUtils.isEmpty(tcUsualScoreList)) {
|
|
|
|
+ List<TCUsualScore> tcUsualScoreFilterList = tcUsualScoreList.stream().filter(s -> Objects.nonNull(s.getScore())).collect(Collectors.toList());
|
|
|
|
+ tcUsualScoreFilterCount = tcUsualScoreFilterList.size();
|
|
|
|
+ }
|
|
|
|
+ if (tcFinalScoreFilterCount > 0 && tcUsualScoreFilterCount > 0) {
|
|
|
|
+ List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
|
+ if (!CollectionUtils.isEmpty(markQuestionList)) {
|
|
|
|
+ paperStructDimensionResultList = new ArrayList<>(markQuestionList.size());
|
|
|
|
+ for (MarkQuestion markQuestion : markQuestionList) {
|
|
|
|
+ paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), examId, markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -264,8 +279,9 @@ public class TCPaperStructController {
|
|
TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
Objects.requireNonNull(tcPaperStruct, "未找到试卷结构");
|
|
Objects.requireNonNull(tcPaperStruct, "未找到试卷结构");
|
|
trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId, false);
|
|
trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId, false);
|
|
- tcFinalScoreService.remove(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
tcPaperStructService.removeById(tcPaperStruct.getId());
|
|
tcPaperStructService.removeById(tcPaperStruct.getId());
|
|
|
|
+ tcFinalScoreService.updateScore(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
+ tcUsualScoreService.updateScore(cultureProgramId, courseId, paperNumber, examId);
|
|
return ResultUtil.ok(true);
|
|
return ResultUtil.ok(true);
|
|
}
|
|
}
|
|
|
|
|