Browse Source

bug修复

dzx 4 months ago
parent
commit
a983c7925f

+ 16 - 13
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -290,21 +290,24 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
 
                 List<Boolean> conditionList = new ArrayList<>();
                 BandingTaskMajorCondition condition = classConditionMap.get(taskClass.getMajorSetId());
-                if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0 ){
-                    conditionList.add(true);
-                }else if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0){
-                    conditionList.add(false);
-                }else if(condition.getHeight() !=null && newStudent.getHeight() == null){
-                    conditionList.add(false);
-                }
+                if(condition != null){
+                    if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0 ){
+                        conditionList.add(true);
+                    }else if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0){
+                        conditionList.add(false);
+                    }else if(condition.getHeight() !=null && newStudent.getHeight() == null){
+                        conditionList.add(false);
+                    }
 
-                if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0 ){
-                    conditionList.add(true);
-                }else if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0){
-                    conditionList.add(false);
-                }else if(condition.getScore() !=null && newStudent.getScore() == null){
-                    conditionList.add(false);
+                    if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0 ){
+                        conditionList.add(true);
+                    }else if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0){
+                        conditionList.add(false);
+                    }else if(condition.getScore() !=null && newStudent.getScore() == null){
+                        conditionList.add(false);
+                    }
                 }
+
                 //如果包含false,则表明不符合条件,这个学生跳过
                 if(conditionList.contains(false)){
                     continue;

+ 3 - 2
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -37,6 +37,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -146,7 +147,7 @@ public class BaseNewStudentController {
         List<Map<String, String>> result = new ArrayList<>();
 
         for (Map<Integer, Object> objectMap : errorList) {
-            Map<String, String> object = new HashMap<>();
+            Map<String, String> object = new LinkedHashMap<>();
             object.put("毕业学校", objectMap.get(0)==null?"":objectMap.get(0).toString());
             object.put("学生姓名", objectMap.get(1)==null?"":objectMap.get(1).toString());
             object.put("性别", objectMap.get(2)==null?"":objectMap.get(2).toString());
@@ -175,7 +176,7 @@ public class BaseNewStudentController {
         List<Map<String, String>> result = new ArrayList<>();
 
         for (BaseNewStudentScoreExcelVo objectMap : errorList) {
-            Map<String, String> object = new HashMap<>();
+            Map<String, String> object = new LinkedHashMap<>();
             object.put("毕业学校", objectMap.getGraduateSchool());
             object.put("姓名", objectMap.getName());
             object.put("性别", objectMap.getGender());