|
|
@@ -281,7 +281,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
|
|
|
if(ruleCodes.contains("BR0002")){
|
|
|
- classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList));
|
|
|
+ classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList, ruleCodes));
|
|
|
}
|
|
|
|
|
|
//存班级和学生的关系
|
|
|
@@ -344,7 +344,14 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
continue;
|
|
|
}
|
|
|
//专业不匹配,直接跳过
|
|
|
- if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
|
|
|
+ if(
|
|
|
+ !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) &&
|
|
|
+ (
|
|
|
+ !ruleCodes.contains("BR0006") &&
|
|
|
+ !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())
|
|
|
+ )
|
|
|
+ )
|
|
|
+ {
|
|
|
continue;
|
|
|
}
|
|
|
//判断该班性别是否已满,如果设置了排序,即使性别满了班级人数没满继续分班
|
|
|
@@ -419,7 +426,14 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
continue;
|
|
|
}
|
|
|
//专业不匹配,直接跳过
|
|
|
- if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
|
|
|
+ //专业不匹配,直接跳过
|
|
|
+ if(
|
|
|
+ !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) &&
|
|
|
+ (
|
|
|
+ !ruleCodes.contains("BR0006") &&
|
|
|
+ !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())
|
|
|
+ )
|
|
|
+ ){
|
|
|
continue;
|
|
|
}
|
|
|
//判断该班性别是否已满
|
|
|
@@ -477,7 +491,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
* @return 班级id和学生
|
|
|
*/
|
|
|
Map<Long, List<BaseNewStudent>> divideStudentByScore(Map<Long, BandingTaskMajorCondition> classConditionMap, List<BaseNewStudent> baseNewStudents,
|
|
|
- List<BandingTaskClass> classList){
|
|
|
+ List<BandingTaskClass> classList, List<String> ruleCodes){
|
|
|
Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
|
|
|
for (Long majorSetId : classConditionMap.keySet()) {
|
|
|
//查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
|
|
|
@@ -493,7 +507,15 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
List<BaseNewStudent> stuList = new ArrayList<>();
|
|
|
|
|
|
for (BaseNewStudent newStudent : baseNewStudents) {
|
|
|
- if(!Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) && !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())){
|
|
|
+ //专业不匹配,直接跳过
|
|
|
+ if(
|
|
|
+ !Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) &&
|
|
|
+ (
|
|
|
+ !ruleCodes.contains("BR0006") &&
|
|
|
+ !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())
|
|
|
+ )
|
|
|
+ )
|
|
|
+ {
|
|
|
continue;
|
|
|
}
|
|
|
|