|
@@ -147,7 +147,7 @@ public class MakrerApi {
|
|
|
Integer levelShowAllPaper = ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper();
|
|
|
Integer propDenominator = ParamCache.paramMap.get(marker.getWorkId()).getPropDenominator();
|
|
|
Long batchNo = null;
|
|
|
- if(levelShowAllPaper == 0){
|
|
|
+ if (levelShowAllPaper == 0) {
|
|
|
batchNo = paperRepo.findMaxBatchNoByWorkIdAndSubject(marker.getWorkId(), marker.getSubject());
|
|
|
}
|
|
|
Long finalBatchNo = batchNo;
|
|
@@ -158,14 +158,14 @@ public class MakrerApi {
|
|
|
Map<String, Long> map = new HashMap<>();
|
|
|
//当前老师当前批次试卷总数
|
|
|
long kdtotal;
|
|
|
- if (levelShowAllPaper == 1) {
|
|
|
+ if (levelShowAllPaper == 1) {
|
|
|
kdtotal = markTaskRepo.countByQuestionIdAll(questionId, marker.getId());
|
|
|
} else {
|
|
|
kdtotal = markTaskRepo.countByQuestionIdAndBatchNo(questionId, finalBatchNo, marker.getId());
|
|
|
}
|
|
|
//当前考区内试卷总数
|
|
|
long total = 0;
|
|
|
- if(propDenominator == 1){
|
|
|
+ if (propDenominator == 1) {
|
|
|
// 全部考生
|
|
|
total = paperRepo.countByWorkIdAndQuestionId(markSubject.getWorkId(), questionId);
|
|
|
} else if (propDenominator == 2) {
|
|
@@ -228,7 +228,8 @@ public class MakrerApi {
|
|
|
}
|
|
|
o.setCount(countNew);
|
|
|
//该档位考区内已定档数量
|
|
|
- long gcountNew = paperRepo.countByQuestionIdAndLevelAndSubjectAndWorkId(questionId, String.valueOf(o.getId()), markSubject.getSubject(), marker.getWorkId()); o.setGcount((int) gcountNew);
|
|
|
+ long gcountNew = paperRepo.countByQuestionIdAndLevelAndSubjectAndWorkId(questionId, String.valueOf(o.getId()), markSubject.getSubject(), marker.getWorkId());
|
|
|
+ o.setGcount((int) gcountNew);
|
|
|
o.setGcount((int) gcountNew);
|
|
|
|
|
|
o.setPt(levelMap.get(o.getId()).getPt());
|
|
@@ -268,7 +269,7 @@ public class MakrerApi {
|
|
|
Integer levelShowAllPaper = ParamCache.paramMap.get(marker.getWorkId()).getLevelShowAllPaper();
|
|
|
Integer propDenominator = ParamCache.paramMap.get(marker.getWorkId()).getPropDenominator();
|
|
|
Long batchNo = null;
|
|
|
- if(levelShowAllPaper == 0){
|
|
|
+ if (levelShowAllPaper == 0) {
|
|
|
batchNo = paperRepo.findMaxBatchNoByWorkIdAndSubject(marker.getWorkId(), marker.getSubject());
|
|
|
}
|
|
|
Long finalBatchNo = batchNo;
|
|
@@ -285,7 +286,7 @@ public class MakrerApi {
|
|
|
}
|
|
|
//当前考区内试卷总数
|
|
|
long total = 0;
|
|
|
- if(propDenominator == 1){
|
|
|
+ if (propDenominator == 1) {
|
|
|
// 全部考生
|
|
|
total = paperRepo.countByWorkIdAndQuestionId(markSubject.getWorkId(), questionId);
|
|
|
} else if (propDenominator == 2) {
|
|
@@ -426,7 +427,7 @@ public class MakrerApi {
|
|
|
dto.setPercent(0.0);
|
|
|
|
|
|
//当前老师当前档位评档次数(所有考试)
|
|
|
- int countNew =0;
|
|
|
+ int countNew = 0;
|
|
|
/*if (ParamCache.paramMap.get(marker.getWorkId()).getScoreShowAllPaper() == 1) {
|
|
|
countNew = markTaskRepo.countScoreByQuestionIdAndStageAndResultAndIsMissingAll(questionId, MarkStage.SCORE.ordinal(), level.getCode(), false, marker.getId());
|
|
|
} else {
|
|
@@ -461,7 +462,7 @@ public class MakrerApi {
|
|
|
o.setGpercent(gbd.doubleValue());
|
|
|
|
|
|
int count;
|
|
|
- if(scoreShowAllPaper == 1){
|
|
|
+ if (scoreShowAllPaper == 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);
|
|
@@ -699,6 +700,7 @@ public class MakrerApi {
|
|
|
|
|
|
/**
|
|
|
* 清空当前阶段数据
|
|
|
+ *
|
|
|
* @param workId
|
|
|
* @param subject
|
|
|
* @param stage
|
|
@@ -707,22 +709,37 @@ public class MakrerApi {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/subject/reset", method = RequestMethod.POST)
|
|
|
- public Object subjectReset(@PathVariable Long workId,
|
|
|
+ public Object subjectReset(@RequestParam Long workId,
|
|
|
@RequestParam Subject subject,
|
|
|
@RequestParam MarkStage stage,
|
|
|
@RequestParam String loginName,
|
|
|
@RequestParam String password) {
|
|
|
- if(Objects.nonNull(workId)){
|
|
|
+ if (Objects.isNull(workId)) {
|
|
|
throw new RuntimeException("工作ID不能为空");
|
|
|
}
|
|
|
- if(Objects.nonNull(subject)){
|
|
|
+ if (Objects.isNull(subject)) {
|
|
|
throw new RuntimeException("科目不能为空");
|
|
|
}
|
|
|
- if (!loginConfig.adminLoginConfig().getLoginName().equals(loginName)) {
|
|
|
- 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().getPassword().equals(password)) {
|
|
|
- throw new RuntimeException("管理员密码错误");
|
|
|
+
|
|
|
+ if (!loginConfig.adminLoginConfig().getLoginName().equals(loginName)) {
|
|
|
+ MarkUser markUser = markUserRepo.findByLoginName(loginName);
|
|
|
+ if (markUser != null && !Objects.equals(Role.ADMIN, markUser.getRole())) {
|
|
|
+ throw new RuntimeException("只有管理员才能操作");
|
|
|
+ } else {
|
|
|
+ if (!password.equals(markUser.getPassword())) {
|
|
|
+ throw new RuntimeException("管理员密码错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!loginConfig.adminLoginConfig().getPassword().equals(password)) {
|
|
|
+ throw new RuntimeException("管理员密码错误");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 清空当前阶段数据
|