|
@@ -295,31 +295,45 @@ public class SubjectQuestionDTO {
|
|
|
}
|
|
|
|
|
|
public boolean validateGroupNumber(List<String> error) {
|
|
|
- Map<String, Integer> trialMap = new HashMap<String, Integer>();
|
|
|
+ Set<Integer> trialSet= new HashSet<>();
|
|
|
Map<Integer,Set<Integer>> arbitrateTypeMap = new HashMap<>();
|
|
|
- Map<Integer, Double> doubleRateMap = new HashMap<>();
|
|
|
- Map<Integer, Double> arbitrateThresholdMap = new HashMap<>();
|
|
|
+ Map<Integer, Set<Double>> doubleRateMap = new HashMap<>();
|
|
|
+ Map<Integer, Set<String>> modeMap = new HashMap<>();
|
|
|
+ Map<Integer, Set<Integer>> policyMap = new HashMap<>();
|
|
|
+ Map<Integer, Set<Double>> arbitrateThresholdMap = new HashMap<>();
|
|
|
+
|
|
|
for (ExamQuestion question : list) {
|
|
|
if (question.getGroupNumber() == null || question.getGroupNumber() < 0) {
|
|
|
error.add("[" + subjectCode + "] 有评卷分组为空的记录");
|
|
|
return false;
|
|
|
}
|
|
|
- Integer trialCount = trialMap.get(question.getSubjectCode());
|
|
|
- if (trialCount == null) {
|
|
|
- trialCount = question.getTrialCount();
|
|
|
- trialMap.put(question.getSubjectCode(), question.getTrialCount());
|
|
|
- }
|
|
|
- if (question.getTrialCount() != trialCount) {
|
|
|
+ trialSet.add(question.getTrialCount());
|
|
|
+ if (trialSet.size()>1) {
|
|
|
error.add("[" + subjectCode + "] 有试评数量不一致的记录");
|
|
|
return false;
|
|
|
}
|
|
|
+ //评卷模式一致
|
|
|
+ Set<String> modeSet = modeMap.get(question.getGroupNumber());
|
|
|
+ if(modeSet == null){
|
|
|
+ modeSet =new HashSet<>();
|
|
|
+ modeSet.add(question.getMarkMode());
|
|
|
+ }
|
|
|
+ if (modeSet.size()>1) {
|
|
|
+ error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 评卷模式不一致的记录");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
//开启双评
|
|
|
- Double doubleRate = doubleRateMap.get(question.getGroupNumber());
|
|
|
- if(doubleRate == null){
|
|
|
- doubleRateMap =new HashMap<>();
|
|
|
- doubleRateMap.put(question.getGroupNumber(),question.getDoubleRate());
|
|
|
+ Set<Double> doubleRateSet = doubleRateMap.get(question.getGroupNumber());
|
|
|
+ if(doubleRateSet == null){
|
|
|
+ doubleRateSet =new HashSet<>();
|
|
|
+ doubleRateSet.add(question.getDoubleRate());
|
|
|
}
|
|
|
- if(doubleRate!=null && doubleRate>0){
|
|
|
+ if (doubleRateSet.size()>1) {
|
|
|
+ error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 双评比例不一致的记录");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!doubleRateSet.isEmpty() && doubleRateSet.iterator().next()!=null && doubleRateSet.iterator().next()>0){
|
|
|
//判断分组方式是否一致
|
|
|
Set<Integer> arbitrateTypeSet= arbitrateTypeMap.get(question.getGroupNumber());
|
|
|
if(arbitrateTypeSet ==null ){
|
|
@@ -331,19 +345,34 @@ public class SubjectQuestionDTO {
|
|
|
return false;
|
|
|
}
|
|
|
arbitrateTypeMap.put(question.getGroupNumber(),arbitrateTypeSet);
|
|
|
- //判断是有有阈值
|
|
|
- Double arbitrateThreshold =arbitrateThresholdMap.get(question.getGroupNumber());
|
|
|
- if(arbitrateThreshold == null ){
|
|
|
- arbitrateThresholdMap.put(question.getGroupNumber(),question.getArbitrateThreshold());
|
|
|
- }
|
|
|
- if(question.getArbitrateType()!=null && question.getArbitrateType()==1 && (question.getArbitrateThreshold()==null || question.getArbitrateThreshold()<=0)){
|
|
|
+
|
|
|
+ if(question.getArbitrateThreshold()==null || question.getArbitrateThreshold()<=0){
|
|
|
error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 仲裁阈值为空");
|
|
|
return false;
|
|
|
- }else if(arbitrateThresholdMap.get(question.getGroupNumber())==null){
|
|
|
- error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 仲裁阈值为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ Set<Double> arbitrateThresholdSet = arbitrateThresholdMap.get(question.getGroupNumber());
|
|
|
+ if(arbitrateThresholdSet == null){
|
|
|
+ arbitrateThresholdSet =new HashSet<>();
|
|
|
+ arbitrateThresholdSet.add(question.getArbitrateThreshold());
|
|
|
+ }
|
|
|
+ if (arbitrateTypeSet.iterator().next()!=null
|
|
|
+ && !arbitrateTypeSet.iterator().next().equals(1)
|
|
|
+ && arbitrateThresholdSet.size()>1) {
|
|
|
+ error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 仲裁阈值不一致的记录");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ //评分规则一致
|
|
|
+ Set<Integer> policySet = policyMap.get(question.getGroupNumber());
|
|
|
+ if(policySet == null){
|
|
|
+ policySet =new HashSet<>();
|
|
|
+ policySet.add(question.getScorePolicy());
|
|
|
+ }
|
|
|
+ if (policySet.size()>1) {
|
|
|
+ error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 判分规则不一致的记录");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return true;
|