|
@@ -2,6 +2,7 @@ package cn.com.qmth.stmms.ms.marking.api;
|
|
|
|
|
|
import cn.com.qmth.stmms.ms.commons.threadPool.MyThreadPool;
|
|
|
import cn.com.qmth.stmms.ms.commons.utils.SqlUtil;
|
|
|
+import cn.com.qmth.stmms.ms.core.cache.ParamCache;
|
|
|
import cn.com.qmth.stmms.ms.core.domain.Level;
|
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkSubject;
|
|
@@ -16,6 +17,7 @@ import cn.com.qmth.stmms.ms.marking.assembler.LevelStatAssembler;
|
|
|
import cn.com.qmth.stmms.ms.marking.assembler.MarkerAssembler;
|
|
|
import cn.com.qmth.stmms.ms.marking.assembler.QuestionStatAssembler;
|
|
|
import cn.com.qmth.stmms.ms.marking.dto.*;
|
|
|
+import javassist.bytecode.stackmap.BasicBlock;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
@@ -141,7 +143,12 @@ public class MakrerApi {
|
|
|
public Map<String, Long> call() throws Exception {
|
|
|
Map<String, Long> map = new HashMap<>();
|
|
|
//当前老师当前试卷的评档次数(不分档位)
|
|
|
- long kdtotal = markTaskRepo.countByQuestionId(questionId, batchNo, marker.getId());
|
|
|
+ long kdtotal;
|
|
|
+ if (ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper() == 1) {
|
|
|
+ kdtotal = markTaskRepo.countByQuestionIdAll(questionId, marker.getId());
|
|
|
+ } else {
|
|
|
+ kdtotal = markTaskRepo.countByQuestionId(questionId, batchNo, marker.getId());
|
|
|
+ }
|
|
|
//当前老师所有的评档次数(不分档位)
|
|
|
long total = paperRepo.countByWorkIdAndQuestionId(markSubject.getWorkId(), questionId);
|
|
|
map.put("kdtotal", kdtotal);
|
|
@@ -156,12 +163,20 @@ public class MakrerApi {
|
|
|
levelStatDTO.setGcount(levelStatDTO.getCount());
|
|
|
if (Objects.isNull(levelStatDTO.getId())) {
|
|
|
//求任务数为null的条数
|
|
|
-// int count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultIsNull(questionId, marker.getId(), MarkStage.LEVEL);
|
|
|
- int count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), false, batchNo);
|
|
|
+ int count;
|
|
|
+ if (ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper() == 1) {
|
|
|
+ count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissingAll(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), false);
|
|
|
+ } else {
|
|
|
+ count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), false, batchNo);
|
|
|
+ }
|
|
|
levelStatDTO.setCount(count);
|
|
|
} else {
|
|
|
-// int count = markTaskRepo.countByQuestionIdAndStageAndResult(questionId, MarkStage.LEVEL, levelStatDTO.getId().toString());
|
|
|
- int count = markTaskRepo.countByQuestionIdAndStageAndResultAndIsMissing(questionId, MarkStage.LEVEL.ordinal(), levelStatDTO.getId().toString(), false, batchNo, marker.getId());
|
|
|
+ int count;
|
|
|
+ if (ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper() == 1) {
|
|
|
+ count = markTaskRepo.countByQuestionIdAndStageAndResultAndIsMissingAll(questionId, MarkStage.LEVEL.ordinal(), levelStatDTO.getId().toString(), false, marker.getId());
|
|
|
+ } else {
|
|
|
+ count = markTaskRepo.countByQuestionIdAndStageAndResultAndIsMissing(questionId, MarkStage.LEVEL.ordinal(), levelStatDTO.getId().toString(), false, batchNo, marker.getId());
|
|
|
+ }
|
|
|
levelStatDTO.setCount(count);
|
|
|
}
|
|
|
levelStatDTOs.add(levelStatDTO);
|
|
@@ -176,7 +191,12 @@ public class MakrerApi {
|
|
|
dto.setPercent(0.0);
|
|
|
|
|
|
//当前老师当前档位评档次数(所有考试)
|
|
|
- int countNew = markTaskRepo.countByQuestionIdAndStageAndResultAndIsMissing(questionId, MarkStage.LEVEL.ordinal(), level.getCode(), false, batchNo, marker.getId());
|
|
|
+ int countNew;
|
|
|
+ if (ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper() == 1) {
|
|
|
+ countNew = markTaskRepo.countByQuestionIdAndStageAndResultAndIsMissingAll(questionId, MarkStage.LEVEL.ordinal(), level.getCode(), false, marker.getId());
|
|
|
+ } else {
|
|
|
+ countNew = markTaskRepo.countByQuestionIdAndStageAndResultAndIsMissing(questionId, MarkStage.LEVEL.ordinal(), level.getCode(), false, batchNo, marker.getId());
|
|
|
+ }
|
|
|
// dto.setPercent(countNew == 0 ? 0D : dto.getPercent());
|
|
|
dto.setCount(countNew);
|
|
|
levelStatDTOs.add(dto);
|
|
@@ -208,8 +228,12 @@ public class MakrerApi {
|
|
|
double gp = (double) o.getGcount() / finalTotal;
|
|
|
BigDecimal gbd = new BigDecimal(gp).setScale(3, RoundingMode.HALF_EVEN);
|
|
|
o.setGpercent(gbd.doubleValue());
|
|
|
-
|
|
|
- int count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResult(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), o.getId().toString(), batchNo);
|
|
|
+ int count;
|
|
|
+ if (ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper() == 1) {
|
|
|
+ count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultAll(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), o.getId().toString());
|
|
|
+ } else {
|
|
|
+ count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResult(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), o.getId().toString(), batchNo);
|
|
|
+ }
|
|
|
o.setPercent(count == 0 ? 0 : o.getPercent());
|
|
|
o.setCount(count);
|
|
|
}
|
|
@@ -251,28 +275,6 @@ public class MakrerApi {
|
|
|
return map;
|
|
|
}
|
|
|
});
|
|
|
- //统计workId下各考点的数量
|
|
|
-// paperRepo.countScoreGroupByLevel(questionId, batchNo)
|
|
|
-// .forEach(o -> {
|
|
|
-// LevelStatDTO levelStatDTO = levelStatAssembler.toScoreDTO(o);
|
|
|
-// levelStatDTO.setGcount(levelStatDTO.getCount());
|
|
|
-// if (Objects.isNull(levelStatDTO.getId())) {
|
|
|
-// //求任务数为null的条数
|
|
|
-// int count = markTaskRepo.countScoreByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(questionId, marker.getId(), MarkStage.SCORE.ordinal(), false, batchNo);
|
|
|
-// levelStatDTO.setCount(count);
|
|
|
-// //查询改档
|
|
|
-// int shiftCount = markTaskRepo.countShiftByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), false, batchNo);
|
|
|
-// levelStatDTO.setShift(shiftCount);
|
|
|
-// //查询改档打分
|
|
|
-// int shiftScoreCount = markTaskRepo.countShiftScoreByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(questionId, marker.getId(), MarkStage.SCORE.ordinal(), false, batchNo);
|
|
|
-// levelStatDTO.setShiftScore(shiftScoreCount - shiftCount);
|
|
|
-// }
|
|
|
-//// else {
|
|
|
-//// int count = markTaskRepo.countScoreByQuestionIdAndStageAndResultAndIsMissing(questionId, MarkStage.SCORE.ordinal(), levelStatDTO.getId().toString(), false, batchNo, marker.getId());
|
|
|
-//// levelStatDTO.setCount(count);
|
|
|
-//// }
|
|
|
-// levelStatDTOs.add(levelStatDTO);
|
|
|
-// });
|
|
|
LevelStatDTO levelStatDTO = new LevelStatDTO();
|
|
|
//求任务数为null的条数
|
|
|
int totalCount = markTaskRepo.countScoreByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(questionId, marker.getId(), MarkStage.SCORE.ordinal(), false, batchNo);
|
|
@@ -295,8 +297,12 @@ public class MakrerApi {
|
|
|
dto.setPercent(0.0);
|
|
|
|
|
|
//当前老师当前档位评档次数(所有考试)
|
|
|
- int countNew = markTaskRepo.countScoreByQuestionIdAndStageAndResultAndIsMissing(questionId, MarkStage.SCORE.ordinal(), level.getCode(), false, batchNo, marker.getId());
|
|
|
-// dto.setPercent(countNew == 0 ? 0D : dto.getPercent());
|
|
|
+ int countNew;
|
|
|
+ if (ParamCache.paramMap.get(marker.getWorkId()).getScoreShowAllPaper() == 1) {
|
|
|
+ countNew = markTaskRepo.countScoreByQuestionIdAndStageAndResultAndIsMissingAll(questionId, MarkStage.SCORE.ordinal(), level.getCode(), false, marker.getId());
|
|
|
+ } else {
|
|
|
+ countNew = markTaskRepo.countScoreByQuestionIdAndStageAndResultAndIsMissing(questionId, MarkStage.SCORE.ordinal(), level.getCode(), false, batchNo, marker.getId());
|
|
|
+ }
|
|
|
dto.setCount(countNew);
|
|
|
levelStatDTOs.add(dto);
|
|
|
}
|
|
@@ -324,7 +330,12 @@ public class MakrerApi {
|
|
|
BigDecimal gbd = new BigDecimal(gp).setScale(3, RoundingMode.HALF_EVEN);
|
|
|
o.setGpercent(gbd.doubleValue());
|
|
|
|
|
|
- int count = markTaskRepo.countScoreByQuestionIdAndMarkerIdAndStageAndResult(questionId, marker.getId(), MarkStage.SCORE.ordinal(), o.getId().toString(), batchNo);
|
|
|
+ int count;
|
|
|
+ if(ParamCache.paramMap.get(marker.getWorkId()).getScoreShowAllPaper() == 1){
|
|
|
+ count = markTaskRepo.countScoreByQuestionIdAndMarkerIdAndStageAndResultAll(questionId, marker.getId(), MarkStage.SCORE.ordinal(), o.getId().toString());
|
|
|
+ } else {
|
|
|
+ count = markTaskRepo.countScoreByQuestionIdAndMarkerIdAndStageAndResult(questionId, marker.getId(), MarkStage.SCORE.ordinal(), o.getId().toString(), batchNo);
|
|
|
+ }
|
|
|
o.setPercent(count == 0 ? 0 : o.getPercent());
|
|
|
o.setCount(count);
|
|
|
}
|