1
0
yin 7 месяцев назад
Родитель
Сommit
eb536415f1

+ 14 - 11
stmms-web/src/main/java/cn/com/qmth/stmms/admin/dto/SubjectQuestionDTO.java

@@ -296,8 +296,9 @@ public class SubjectQuestionDTO {
 
     public boolean validateGroupNumber(List<String> error) {
         Map<String, Integer> trialMap = new HashMap<String, Integer>();
-        Map<String, Map<Integer,Set<Integer>>> arbitrateTypeMap = new HashMap<>();
+        Map<Integer,Set<Integer>> arbitrateTypeMap = new HashMap<>();
         Map<Integer, Double> doubleRateMap = new HashMap<>();
+        Map<Integer, Double> arbitrateThresholdMap = new HashMap<>();
         for (ExamQuestion question : list) {
             if (question.getGroupNumber() == null || question.getGroupNumber() < 0) {
                 error.add("[" + subjectCode + "] 有评卷分组为空的记录");
@@ -320,11 +321,7 @@ public class SubjectQuestionDTO {
             }
             if(doubleRate!=null && doubleRate>0){
                 //判断分组方式是否一致
-                Map<Integer,Set<Integer>> groupArbitrateTypeMap= arbitrateTypeMap.get(question.getSubjectCode());
-                if(groupArbitrateTypeMap ==null){
-                    groupArbitrateTypeMap = new HashMap<>();
-                }
-                Set<Integer> arbitrateTypeSet= groupArbitrateTypeMap.get(question.getGroupNumber());
+                Set<Integer> arbitrateTypeSet= arbitrateTypeMap.get(question.getGroupNumber());
                 if(arbitrateTypeSet ==null ){
                     arbitrateTypeSet = new HashSet<>();
                 }
@@ -333,14 +330,20 @@ public class SubjectQuestionDTO {
                     error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 仲裁方式不一致");
                     return false;
                 }
-
-                groupArbitrateTypeMap.put(question.getGroupNumber(),arbitrateTypeSet);
-                arbitrateTypeMap.put(question.getSubjectCode(),groupArbitrateTypeMap);
-
-                if(1==question.getArbitrateType() && (question.getArbitrateThreshold()==null || question.getArbitrateThreshold()<=0)){
+                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)){
+                    error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 仲裁阈值为空");
+                    return false;
+                }else if(arbitrateThresholdMap.get(question.getGroupNumber())==null){
                     error.add("[" + subjectCode + "] 分组号" + question.getGroupNumber() + " 仲裁阈值为空");
                     return false;
                 }
+
             }
         }
         return true;