|
@@ -1,5 +1,6 @@
|
|
package cn.com.qmth.stmms.ms.marking.api;
|
|
package cn.com.qmth.stmms.ms.marking.api;
|
|
|
|
|
|
|
|
+import cn.com.qmth.stmms.ms.accesscontrol.config.LoginConfig;
|
|
import cn.com.qmth.stmms.ms.commons.threadPool.MyThreadPool;
|
|
import cn.com.qmth.stmms.ms.commons.threadPool.MyThreadPool;
|
|
import cn.com.qmth.stmms.ms.commons.utils.SqlUtil;
|
|
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.cache.ParamCache;
|
|
@@ -17,6 +18,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.MarkerAssembler;
|
|
import cn.com.qmth.stmms.ms.marking.assembler.QuestionStatAssembler;
|
|
import cn.com.qmth.stmms.ms.marking.assembler.QuestionStatAssembler;
|
|
import cn.com.qmth.stmms.ms.marking.dto.*;
|
|
import cn.com.qmth.stmms.ms.marking.dto.*;
|
|
|
|
+import cn.com.qmth.stmms.ms.marking.service.MarkingService;
|
|
import javassist.bytecode.stackmap.BasicBlock;
|
|
import javassist.bytecode.stackmap.BasicBlock;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -73,6 +75,12 @@ public class MakrerApi {
|
|
@Autowired
|
|
@Autowired
|
|
StudentRepo studentRepo;
|
|
StudentRepo studentRepo;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private LoginConfig loginConfig;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ MarkingService markingService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 评卷员信息
|
|
* 评卷员信息
|
|
*
|
|
*
|
|
@@ -140,7 +148,7 @@ public class MakrerApi {
|
|
Integer levelShowAllPaper = ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper();
|
|
Integer levelShowAllPaper = ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper();
|
|
Integer propDenominator = ParamCache.paramMap.get(marker.getWorkId()).getPropDenominator();
|
|
Integer propDenominator = ParamCache.paramMap.get(marker.getWorkId()).getPropDenominator();
|
|
Long batchNo = null;
|
|
Long batchNo = null;
|
|
- if(levelShowAllPaper == 0){
|
|
|
|
|
|
+ if (levelShowAllPaper == 0) {
|
|
batchNo = paperRepo.findMaxBatchNoByWorkIdAndSubject(marker.getWorkId(), marker.getSubject());
|
|
batchNo = paperRepo.findMaxBatchNoByWorkIdAndSubject(marker.getWorkId(), marker.getSubject());
|
|
}
|
|
}
|
|
Long finalBatchNo = batchNo;
|
|
Long finalBatchNo = batchNo;
|
|
@@ -159,7 +167,7 @@ public class MakrerApi {
|
|
}
|
|
}
|
|
//当前考区内试卷总数
|
|
//当前考区内试卷总数
|
|
long total = 0;
|
|
long total = 0;
|
|
- if(propDenominator == 1){
|
|
|
|
|
|
+ if (propDenominator == 1) {
|
|
// 全部考生
|
|
// 全部考生
|
|
total = paperRepo.countByWorkIdAndQuestionId(markSubject.getWorkId(), questionId);
|
|
total = paperRepo.countByWorkIdAndQuestionId(markSubject.getWorkId(), questionId);
|
|
} else if (propDenominator == 2) {
|
|
} else if (propDenominator == 2) {
|
|
@@ -174,24 +182,24 @@ public class MakrerApi {
|
|
//当前考区各档位定档数量
|
|
//当前考区各档位定档数量
|
|
List<Object[]> list = paperRepo.countGroupByLevel(questionId);
|
|
List<Object[]> list = paperRepo.countGroupByLevel(questionId);
|
|
list.forEach(o -> {
|
|
list.forEach(o -> {
|
|
- LevelStatDTO levelStatDTO = levelStatAssembler.toDTO(o);
|
|
|
|
- levelStatDTO.setGcount(levelStatDTO.getCount());
|
|
|
|
- if (Objects.isNull(levelStatDTO.getId())) {
|
|
|
|
- //求任务数为null的条数
|
|
|
|
- int count;
|
|
|
|
- if (levelShowAllPaper == 1) {
|
|
|
|
- count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultIsNullAll(questionId, marker.getId(), MarkStage.LEVEL.ordinal());
|
|
|
|
- } else {
|
|
|
|
- count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultNull(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), finalBatchNo);
|
|
|
|
- }
|
|
|
|
- //查询当前老师打回个数
|
|
|
|
|
|
+ LevelStatDTO levelStatDTO = levelStatAssembler.toDTO(o);
|
|
|
|
+ levelStatDTO.setGcount(levelStatDTO.getCount());
|
|
|
|
+ if (Objects.isNull(levelStatDTO.getId())) {
|
|
|
|
+ //求任务数为null的条数
|
|
|
|
+ int count;
|
|
|
|
+ if (levelShowAllPaper == 1) {
|
|
|
|
+ count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultIsNullAll(questionId, marker.getId(), MarkStage.LEVEL.ordinal());
|
|
|
|
+ } else {
|
|
|
|
+ count = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndResultNull(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), finalBatchNo);
|
|
|
|
+ }
|
|
|
|
+ //查询当前老师打回个数
|
|
// int rejectCount = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndIsRejectedTrueAndIsMissing(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), false);
|
|
// int rejectCount = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndIsRejectedTrueAndIsMissing(questionId, marker.getId(), MarkStage.LEVEL.ordinal(), false);
|
|
- int rejectCount = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndIsRejectedTrue(questionId, marker.getId(), MarkStage.LEVEL.ordinal());
|
|
|
|
- levelStatDTO.setCount(count);
|
|
|
|
- levelStatDTO.setRejected(rejectCount);
|
|
|
|
- }
|
|
|
|
- levelStatDTOs.add(levelStatDTO);
|
|
|
|
- });
|
|
|
|
|
|
+ int rejectCount = markTaskRepo.countByQuestionIdAndMarkerIdAndStageAndIsRejectedTrue(questionId, marker.getId(), MarkStage.LEVEL.ordinal());
|
|
|
|
+ levelStatDTO.setCount(count);
|
|
|
|
+ levelStatDTO.setRejected(rejectCount);
|
|
|
|
+ }
|
|
|
|
+ levelStatDTOs.add(levelStatDTO);
|
|
|
|
+ });
|
|
for (Level level : levels) {
|
|
for (Level level : levels) {
|
|
//所有档位依次比较
|
|
//所有档位依次比较
|
|
long count = levelStatDTOs.stream().filter(l -> String.valueOf(l.getId()).equals(level.getCode())).count();
|
|
long count = levelStatDTOs.stream().filter(l -> String.valueOf(l.getId()).equals(level.getCode())).count();
|
|
@@ -264,7 +272,7 @@ public class MakrerApi {
|
|
Integer levelShowAllPaper = ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper();
|
|
Integer levelShowAllPaper = ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper();
|
|
Integer propDenominator = ParamCache.paramMap.get(marker.getWorkId()).getPropDenominator();
|
|
Integer propDenominator = ParamCache.paramMap.get(marker.getWorkId()).getPropDenominator();
|
|
Long batchNo = null;
|
|
Long batchNo = null;
|
|
- if(levelShowAllPaper == 0){
|
|
|
|
|
|
+ if (levelShowAllPaper == 0) {
|
|
batchNo = paperRepo.findMaxBatchNoByWorkIdAndSubject(marker.getWorkId(), marker.getSubject());
|
|
batchNo = paperRepo.findMaxBatchNoByWorkIdAndSubject(marker.getWorkId(), marker.getSubject());
|
|
}
|
|
}
|
|
Long finalBatchNo = batchNo;
|
|
Long finalBatchNo = batchNo;
|
|
@@ -281,7 +289,7 @@ public class MakrerApi {
|
|
}
|
|
}
|
|
//当前考区内试卷总数
|
|
//当前考区内试卷总数
|
|
long total = 0;
|
|
long total = 0;
|
|
- if(propDenominator == 1){
|
|
|
|
|
|
+ if (propDenominator == 1) {
|
|
// 全部考生
|
|
// 全部考生
|
|
total = paperRepo.countByWorkIdAndQuestionId(markSubject.getWorkId(), questionId);
|
|
total = paperRepo.countByWorkIdAndQuestionId(markSubject.getWorkId(), questionId);
|
|
} else if (propDenominator == 2) {
|
|
} else if (propDenominator == 2) {
|
|
@@ -674,4 +682,46 @@ public class MakrerApi {
|
|
return objectMap;
|
|
return objectMap;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 清空当前阶段数据
|
|
|
|
+ *
|
|
|
|
+ * @param workId
|
|
|
|
+ * @param subject
|
|
|
|
+ * @param stage
|
|
|
|
+ * @param loginName
|
|
|
|
+ * @param password
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/subject/reset", method = RequestMethod.POST)
|
|
|
|
+ public Object subjectReset(@RequestParam Long workId,
|
|
|
|
+ @RequestParam Subject subject,
|
|
|
|
+ @RequestParam MarkStage stage,
|
|
|
|
+ @RequestParam String loginName,
|
|
|
|
+ @RequestParam String password) {
|
|
|
|
+ if (Objects.isNull(workId)) {
|
|
|
|
+ throw new RuntimeException("工作ID不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (Objects.isNull(subject)) {
|
|
|
|
+ throw new RuntimeException("科目不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (Objects.isNull(stage) || (!Objects.equals(MarkStage.LEVEL, stage) && !Objects.equals(MarkStage.SCORE, stage))) {
|
|
|
|
+ throw new RuntimeException("只有分档和打分阶段才能清除");
|
|
|
|
+ }
|
|
|
|
+ if (Objects.isNull(password)) {
|
|
|
|
+ throw new RuntimeException("密码不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!loginConfig.adminLoginConfig().getLoginName().equals(loginName)) {
|
|
|
|
+ throw new RuntimeException("只有管理员才能操作");
|
|
|
|
+ }
|
|
|
|
+ if (!loginConfig.adminLoginConfig().getPassword().equals(password)) {
|
|
|
|
+ throw new RuntimeException("管理员密码错误");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 清空当前阶段数据
|
|
|
|
+ markingService.subjectReset(workId, subject, stage);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|