|
@@ -51,6 +51,7 @@ import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -235,7 +236,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
List<BaseNewStudent> femaleList = new ArrayList();
|
|
List<BaseNewStudent> femaleList = new ArrayList();
|
|
|
List<BaseNewStudent> studentList = new ArrayList<>();
|
|
List<BaseNewStudent> studentList = new ArrayList<>();
|
|
|
studentList.addAll(baseNewStudents);
|
|
studentList.addAll(baseNewStudents);
|
|
|
- if(ruleCodes.contains("BR0002") && !classStudentMap.get(taskClass.getMajorSetId()).isEmpty()){
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0002") && classStudentMap.get(taskClass.getMajorSetId()) != null && !classStudentMap.get(taskClass.getMajorSetId()).isEmpty()){
|
|
|
studentList.clear();
|
|
studentList.clear();
|
|
|
studentList.addAll(classStudentMap.get(taskClass.getMajorSetId()));
|
|
studentList.addAll(classStudentMap.get(taskClass.getMajorSetId()));
|
|
|
}
|
|
}
|
|
@@ -353,8 +354,15 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
}
|
|
}
|
|
|
stuList.add(newStudent);
|
|
stuList.add(newStudent);
|
|
|
}
|
|
}
|
|
|
|
|
+ if(!stuList.isEmpty()){
|
|
|
|
|
+ for (BaseNewStudent student : stuList) {
|
|
|
|
|
+ if(student.getScore() == null){
|
|
|
|
|
+ student.setScore(BigDecimal.ZERO);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Collections.sort(stuList, (s1, s2) -> (int) (s2.getScore().doubleValue() - s1.getScore().doubleValue())); //按照成绩降序排序
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- Collections.sort(stuList, (s1, s2) -> (int) (s2.getScore().doubleValue() - s1.getScore().doubleValue())); //按照成绩降序排序
|
|
|
|
|
//查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
|
|
//查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
|
|
|
List<List<BaseNewStudent>> result = new ArrayList<>();
|
|
List<List<BaseNewStudent>> result = new ArrayList<>();
|
|
|
for (int i = 0; i < classList.size(); i++) {
|
|
for (int i = 0; i < classList.size(); i++) {
|
|
@@ -363,7 +371,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
|
|
for (int i = 0; i < stuList.size(); i++) {
|
|
for (int i = 0; i < stuList.size(); i++) {
|
|
|
BaseNewStudent currentStudent = stuList.get(i);
|
|
BaseNewStudent currentStudent = stuList.get(i);
|
|
|
- int classIndex = i % stuList.size(); //分配班级
|
|
|
|
|
|
|
+ int classIndex = i % classList.size(); //分配班级
|
|
|
result.get(classIndex).add(currentStudent);
|
|
result.get(classIndex).add(currentStudent);
|
|
|
}
|
|
}
|
|
|
|
|
|