|
@@ -2,14 +2,15 @@ package cn.com.qmth.stmms.ms.admin.api;
|
|
|
|
|
|
import cn.com.qmth.stmms.ms.commons.utils.ServletUtil;
|
|
import cn.com.qmth.stmms.ms.commons.utils.ServletUtil;
|
|
import cn.com.qmth.stmms.ms.core.cache.ParamCache;
|
|
import cn.com.qmth.stmms.ms.core.cache.ParamCache;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkSubject;
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkSubject;
|
|
import cn.com.qmth.stmms.ms.core.domain.Paper;
|
|
import cn.com.qmth.stmms.ms.core.domain.Paper;
|
|
import cn.com.qmth.stmms.ms.core.domain.ParamSetting;
|
|
import cn.com.qmth.stmms.ms.core.domain.ParamSetting;
|
|
import cn.com.qmth.stmms.ms.core.domain.enums.ParamSettingTypeEnum;
|
|
import cn.com.qmth.stmms.ms.core.domain.enums.ParamSettingTypeEnum;
|
|
import cn.com.qmth.stmms.ms.core.domain.enums.TrialEnum;
|
|
import cn.com.qmth.stmms.ms.core.domain.enums.TrialEnum;
|
|
-import cn.com.qmth.stmms.ms.core.domain.paramsetting.RoughLevelConfig;
|
|
|
|
import cn.com.qmth.stmms.ms.core.domain.paramsetting.CollectConfig;
|
|
import cn.com.qmth.stmms.ms.core.domain.paramsetting.CollectConfig;
|
|
import cn.com.qmth.stmms.ms.core.domain.paramsetting.LevelConfig;
|
|
import cn.com.qmth.stmms.ms.core.domain.paramsetting.LevelConfig;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.paramsetting.RoughLevelConfig;
|
|
import cn.com.qmth.stmms.ms.core.domain.paramsetting.ScoreConfig;
|
|
import cn.com.qmth.stmms.ms.core.domain.paramsetting.ScoreConfig;
|
|
import cn.com.qmth.stmms.ms.core.repository.*;
|
|
import cn.com.qmth.stmms.ms.core.repository.*;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -38,9 +39,15 @@ public class ParamApi {
|
|
@Resource
|
|
@Resource
|
|
private MarkSubjectRepo markSubjectRepo;
|
|
private MarkSubjectRepo markSubjectRepo;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private MarkTaskRoughLevelRepo markTaskRoughLevelRepo;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
private MarkTaskLevelRepo markTaskLevelRepo;
|
|
private MarkTaskLevelRepo markTaskLevelRepo;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private MarkTaskScoreRepo markTaskScoreRepo;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询
|
|
* 查询
|
|
*
|
|
*
|
|
@@ -70,11 +77,12 @@ public class ParamApi {
|
|
if (paramSetting == null) {
|
|
if (paramSetting == null) {
|
|
paramSetting = ParamSetting.init(workId);
|
|
paramSetting = ParamSetting.init(workId);
|
|
}
|
|
}
|
|
- // todo 需要改查询表,判断粗分档和细分档 20220728
|
|
|
|
- int countMarkTasks = markTaskLevelRepo.countByWorkId(workId);
|
|
|
|
|
|
+
|
|
|
|
+ // 是否全部为采集阶段
|
|
|
|
+ List<MarkSubject> workIdAndStageNot = markSubjectRepo.findAllByWorkIdAndStageNot(workId, MarkStage.INIT);
|
|
|
|
|
|
CollectConfig oldCollectConfig = JSON.parseObject(paramSetting.getCollectConfig(), CollectConfig.class);
|
|
CollectConfig oldCollectConfig = JSON.parseObject(paramSetting.getCollectConfig(), CollectConfig.class);
|
|
- if (countMarkTasks > 0 && !Objects.equals(packageScan, oldCollectConfig.getPackageScan())) {
|
|
|
|
|
|
+ if (workIdAndStageNot != null && !workIdAndStageNot.isEmpty() && !Objects.equals(packageScan, oldCollectConfig.getPackageScan())) {
|
|
throw new RuntimeException("该评卷工作当前不是采集阶段,不能修改是【否整包扫描】参数");
|
|
throw new RuntimeException("该评卷工作当前不是采集阶段,不能修改是【否整包扫描】参数");
|
|
}
|
|
}
|
|
//有采集数据,不能修改采集参数
|
|
//有采集数据,不能修改采集参数
|
|
@@ -103,12 +111,12 @@ public class ParamApi {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 细分档规则参数
|
|
|
|
|
|
+ * 粗分档规则参数
|
|
*
|
|
*
|
|
* @param data data
|
|
* @param data data
|
|
*/
|
|
*/
|
|
- @PostMapping("/level")
|
|
|
|
- public ResponseEntity updateLevelParam(@RequestBody String data) {
|
|
|
|
|
|
+ @PostMapping("/rough_level")
|
|
|
|
+ public ResponseEntity updateFirstLevelParam(@RequestBody String data) {
|
|
Long workId = ServletUtil.getWordId();
|
|
Long workId = ServletUtil.getWordId();
|
|
JSONObject object = JSON.parseObject(data);
|
|
JSONObject object = JSON.parseObject(data);
|
|
Integer deviation = object.getInteger("deviation");
|
|
Integer deviation = object.getInteger("deviation");
|
|
@@ -119,62 +127,57 @@ public class ParamApi {
|
|
Integer levelShowAllPaper = object.getInteger("levelShowAllPaper");
|
|
Integer levelShowAllPaper = object.getInteger("levelShowAllPaper");
|
|
Integer propDenominator = object.getInteger("propDenominator");
|
|
Integer propDenominator = object.getInteger("propDenominator");
|
|
Integer showStandardPaperManage = object.getInteger("showStandardPaperManage");
|
|
Integer showStandardPaperManage = object.getInteger("showStandardPaperManage");
|
|
- Integer roughLevelEnable = object.getInteger("roughLevelEnable");
|
|
|
|
Integer removeHighAndLow = object.getInteger("removeHighAndLow");
|
|
Integer removeHighAndLow = object.getInteger("removeHighAndLow");
|
|
|
|
|
|
List<MarkSubject> markSubjects = markSubjectRepo.findByWorkIdAndTestNot(workId, TrialEnum.DEFAULT.ordinal());
|
|
List<MarkSubject> markSubjects = markSubjectRepo.findByWorkIdAndTestNot(workId, TrialEnum.DEFAULT.ordinal());
|
|
- // todo 需要改查询表,判断粗分档和细分档 20220728
|
|
|
|
- int countMarkTasks = markTaskLevelRepo.countByWorkId(workId);
|
|
|
|
|
|
+
|
|
|
|
+ int countMarkTasks = markTaskRoughLevelRepo.countByWorkId(workId);
|
|
//保存分档参数
|
|
//保存分档参数
|
|
ParamSetting paramSetting = paramSettingRepo.findByWorkId(workId);
|
|
ParamSetting paramSetting = paramSettingRepo.findByWorkId(workId);
|
|
if (paramSetting == null) {
|
|
if (paramSetting == null) {
|
|
paramSetting = ParamSetting.init(workId);
|
|
paramSetting = ParamSetting.init(workId);
|
|
}
|
|
}
|
|
|
|
|
|
- LevelConfig oldLevelConfig = JSON.parseObject(paramSetting.getLevelConfig(), LevelConfig.class);
|
|
|
|
|
|
+ RoughLevelConfig oldRoughLevelConfig = JSON.parseObject(paramSetting.getRoughLevelConfig(), RoughLevelConfig.class);
|
|
if ((markSubjects == null || markSubjects.isEmpty()) && countMarkTasks > 0) {
|
|
if ((markSubjects == null || markSubjects.isEmpty()) && countMarkTasks > 0) {
|
|
- if (!Objects.equals(deviation, oldLevelConfig.getDeviation())) {
|
|
|
|
|
|
+ if (!Objects.equals(deviation, oldRoughLevelConfig.getDeviation())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【仲裁档位差】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【仲裁档位差】参数");
|
|
}
|
|
}
|
|
- if (!Objects.equals(autoCallback, oldLevelConfig.getAutoCallback())) {
|
|
|
|
|
|
+ if (!Objects.equals(autoCallback, oldRoughLevelConfig.getAutoCallback())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修【系统自动打回】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修【系统自动打回】参数");
|
|
}
|
|
}
|
|
- if (!Objects.equals(majority, oldLevelConfig.getMajority())) {
|
|
|
|
|
|
+ if (!Objects.equals(majority, oldRoughLevelConfig.getMajority())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否过半定档】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否过半定档】参数");
|
|
}
|
|
}
|
|
- if (!Objects.equals(roughLevelEnable, oldLevelConfig.getRoughLevelEnable())) {
|
|
|
|
- throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否增加粗档位环节】参数");
|
|
|
|
- }
|
|
|
|
- if (!Objects.equals(removeHighAndLow, oldLevelConfig.getRemoveHighAndLow())) {
|
|
|
|
|
|
+ if (!Objects.equals(removeHighAndLow, oldRoughLevelConfig.getRemoveHighAndLow())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否开启去高去低再加权评卷】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否开启去高去低再加权评卷】参数");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- oldLevelConfig.setDeviation(deviation);
|
|
|
|
- oldLevelConfig.setAutoCallback(autoCallback);
|
|
|
|
- oldLevelConfig.setMajority(majority);
|
|
|
|
- oldLevelConfig.setTakeBest(takeBest);
|
|
|
|
- oldLevelConfig.setLevelShowAllPaper(levelShowAllPaper);
|
|
|
|
- oldLevelConfig.setPropDenominator(propDenominator);
|
|
|
|
- oldLevelConfig.setShowStandardPaperManage(showStandardPaperManage);
|
|
|
|
- oldLevelConfig.setClearData(clearData);
|
|
|
|
- oldLevelConfig.setRoughLevelEnable(roughLevelEnable);
|
|
|
|
- oldLevelConfig.setRemoveHighAndLow(removeHighAndLow);
|
|
|
|
|
|
+ oldRoughLevelConfig.setDeviation(deviation);
|
|
|
|
+ oldRoughLevelConfig.setAutoCallback(autoCallback);
|
|
|
|
+ oldRoughLevelConfig.setMajority(majority);
|
|
|
|
+ oldRoughLevelConfig.setTakeBest(takeBest);
|
|
|
|
+ oldRoughLevelConfig.setLevelShowAllPaper(levelShowAllPaper);
|
|
|
|
+ oldRoughLevelConfig.setPropDenominator(propDenominator);
|
|
|
|
+ oldRoughLevelConfig.setShowStandardPaperManage(showStandardPaperManage);
|
|
|
|
+ oldRoughLevelConfig.setClearData(clearData);
|
|
|
|
+ oldRoughLevelConfig.setRemoveHighAndLow(removeHighAndLow);
|
|
|
|
|
|
- paramSetting.setLevelConfig(JSON.toJSONString(oldLevelConfig));
|
|
|
|
|
|
+ paramSetting.setRoughLevelConfig(JSON.toJSONString(oldRoughLevelConfig));
|
|
paramSettingRepo.saveAndFlush(paramSetting);
|
|
paramSettingRepo.saveAndFlush(paramSetting);
|
|
- ParamCache.cacheParam(ParamSettingTypeEnum.LEVEL, workId, paramSetting.getLevelConfig());
|
|
|
|
|
|
+ ParamCache.cacheParam(ParamSettingTypeEnum.ROUGH_LEVEL, workId, paramSetting.getRoughLevelConfig());
|
|
|
|
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 粗分档规则参数
|
|
|
|
|
|
+ * 细分档规则参数
|
|
*
|
|
*
|
|
* @param data data
|
|
* @param data data
|
|
*/
|
|
*/
|
|
- @PostMapping("/rough_level")
|
|
|
|
- public ResponseEntity updateFirstLevelParam(@RequestBody String data) {
|
|
|
|
|
|
+ @PostMapping("/level")
|
|
|
|
+ public ResponseEntity updateLevelParam(@RequestBody String data) {
|
|
Long workId = ServletUtil.getWordId();
|
|
Long workId = ServletUtil.getWordId();
|
|
JSONObject object = JSON.parseObject(data);
|
|
JSONObject object = JSON.parseObject(data);
|
|
Integer deviation = object.getInteger("deviation");
|
|
Integer deviation = object.getInteger("deviation");
|
|
@@ -185,10 +188,10 @@ public class ParamApi {
|
|
Integer levelShowAllPaper = object.getInteger("levelShowAllPaper");
|
|
Integer levelShowAllPaper = object.getInteger("levelShowAllPaper");
|
|
Integer propDenominator = object.getInteger("propDenominator");
|
|
Integer propDenominator = object.getInteger("propDenominator");
|
|
Integer showStandardPaperManage = object.getInteger("showStandardPaperManage");
|
|
Integer showStandardPaperManage = object.getInteger("showStandardPaperManage");
|
|
|
|
+ Integer roughLevelEnable = object.getInteger("roughLevelEnable");
|
|
Integer removeHighAndLow = object.getInteger("removeHighAndLow");
|
|
Integer removeHighAndLow = object.getInteger("removeHighAndLow");
|
|
|
|
|
|
List<MarkSubject> markSubjects = markSubjectRepo.findByWorkIdAndTestNot(workId, TrialEnum.DEFAULT.ordinal());
|
|
List<MarkSubject> markSubjects = markSubjectRepo.findByWorkIdAndTestNot(workId, TrialEnum.DEFAULT.ordinal());
|
|
- // todo 需要改查询表,判断粗分档和细分档 20220728
|
|
|
|
int countMarkTasks = markTaskLevelRepo.countByWorkId(workId);
|
|
int countMarkTasks = markTaskLevelRepo.countByWorkId(workId);
|
|
//保存分档参数
|
|
//保存分档参数
|
|
ParamSetting paramSetting = paramSettingRepo.findByWorkId(workId);
|
|
ParamSetting paramSetting = paramSettingRepo.findByWorkId(workId);
|
|
@@ -196,39 +199,44 @@ public class ParamApi {
|
|
paramSetting = ParamSetting.init(workId);
|
|
paramSetting = ParamSetting.init(workId);
|
|
}
|
|
}
|
|
|
|
|
|
- RoughLevelConfig oldRoughLevelConfig = JSON.parseObject(paramSetting.getRoughLevelConfig(), RoughLevelConfig.class);
|
|
|
|
|
|
+ LevelConfig oldLevelConfig = JSON.parseObject(paramSetting.getLevelConfig(), LevelConfig.class);
|
|
if ((markSubjects == null || markSubjects.isEmpty()) && countMarkTasks > 0) {
|
|
if ((markSubjects == null || markSubjects.isEmpty()) && countMarkTasks > 0) {
|
|
- if (!Objects.equals(deviation, oldRoughLevelConfig.getDeviation())) {
|
|
|
|
|
|
+ if (!Objects.equals(deviation, oldLevelConfig.getDeviation())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【仲裁档位差】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【仲裁档位差】参数");
|
|
}
|
|
}
|
|
- if (!Objects.equals(autoCallback, oldRoughLevelConfig.getAutoCallback())) {
|
|
|
|
|
|
+ if (!Objects.equals(autoCallback, oldLevelConfig.getAutoCallback())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修【系统自动打回】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修【系统自动打回】参数");
|
|
}
|
|
}
|
|
- if (!Objects.equals(majority, oldRoughLevelConfig.getMajority())) {
|
|
|
|
|
|
+ if (!Objects.equals(majority, oldLevelConfig.getMajority())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否过半定档】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否过半定档】参数");
|
|
}
|
|
}
|
|
- if (!Objects.equals(removeHighAndLow, oldRoughLevelConfig.getRemoveHighAndLow())) {
|
|
|
|
|
|
+ if (!Objects.equals(roughLevelEnable, oldLevelConfig.getRoughLevelEnable())) {
|
|
|
|
+ throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否增加粗档位环节】参数");
|
|
|
|
+ }
|
|
|
|
+ if (!Objects.equals(removeHighAndLow, oldLevelConfig.getRemoveHighAndLow())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否开启去高去低再加权评卷】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【是否开启去高去低再加权评卷】参数");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- oldRoughLevelConfig.setDeviation(deviation);
|
|
|
|
- oldRoughLevelConfig.setAutoCallback(autoCallback);
|
|
|
|
- oldRoughLevelConfig.setMajority(majority);
|
|
|
|
- oldRoughLevelConfig.setTakeBest(takeBest);
|
|
|
|
- oldRoughLevelConfig.setLevelShowAllPaper(levelShowAllPaper);
|
|
|
|
- oldRoughLevelConfig.setPropDenominator(propDenominator);
|
|
|
|
- oldRoughLevelConfig.setShowStandardPaperManage(showStandardPaperManage);
|
|
|
|
- oldRoughLevelConfig.setClearData(clearData);
|
|
|
|
- oldRoughLevelConfig.setRemoveHighAndLow(removeHighAndLow);
|
|
|
|
|
|
+ oldLevelConfig.setDeviation(deviation);
|
|
|
|
+ oldLevelConfig.setAutoCallback(autoCallback);
|
|
|
|
+ oldLevelConfig.setMajority(majority);
|
|
|
|
+ oldLevelConfig.setTakeBest(takeBest);
|
|
|
|
+ oldLevelConfig.setLevelShowAllPaper(levelShowAllPaper);
|
|
|
|
+ oldLevelConfig.setPropDenominator(propDenominator);
|
|
|
|
+ oldLevelConfig.setShowStandardPaperManage(showStandardPaperManage);
|
|
|
|
+ oldLevelConfig.setClearData(clearData);
|
|
|
|
+ oldLevelConfig.setRoughLevelEnable(roughLevelEnable);
|
|
|
|
+ oldLevelConfig.setRemoveHighAndLow(removeHighAndLow);
|
|
|
|
|
|
- paramSetting.setRoughLevelConfig(JSON.toJSONString(oldRoughLevelConfig));
|
|
|
|
|
|
+ paramSetting.setLevelConfig(JSON.toJSONString(oldLevelConfig));
|
|
paramSettingRepo.saveAndFlush(paramSetting);
|
|
paramSettingRepo.saveAndFlush(paramSetting);
|
|
- ParamCache.cacheParam(ParamSettingTypeEnum.ROUGH_LEVEL, workId, paramSetting.getRoughLevelConfig());
|
|
|
|
|
|
+ ParamCache.cacheParam(ParamSettingTypeEnum.LEVEL, workId, paramSetting.getLevelConfig());
|
|
|
|
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 打分改档参数
|
|
* 打分改档参数
|
|
*
|
|
*
|
|
@@ -251,8 +259,8 @@ public class ParamApi {
|
|
|
|
|
|
ScoreConfig oldScoreConfig = JSON.parseObject(paramSetting.getScoreConfig(), ScoreConfig.class);
|
|
ScoreConfig oldScoreConfig = JSON.parseObject(paramSetting.getScoreConfig(), ScoreConfig.class);
|
|
List<MarkSubject> markSubjects = markSubjectRepo.findByWorkIdAndTestNot(workId, TrialEnum.DEFAULT.ordinal());
|
|
List<MarkSubject> markSubjects = markSubjectRepo.findByWorkIdAndTestNot(workId, TrialEnum.DEFAULT.ordinal());
|
|
- // todo 更新查询表 20220801
|
|
|
|
- int countMarkTasks = markTaskLevelRepo.countByWorkId(workId);
|
|
|
|
|
|
+
|
|
|
|
+ int countMarkTasks = markTaskScoreRepo.countByWorkId(workId);
|
|
if ((markSubjects == null || markSubjects.isEmpty()) && countMarkTasks > 0) {
|
|
if ((markSubjects == null || markSubjects.isEmpty()) && countMarkTasks > 0) {
|
|
if (!Objects.equals(roundUp, oldScoreConfig.getRoundUp())) {
|
|
if (!Objects.equals(roundUp, oldScoreConfig.getRoundUp())) {
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【分数处理方式】参数");
|
|
throw new RuntimeException("该评卷工作已有评卷数据,不能修改【分数处理方式】参数");
|