|
@@ -8,7 +8,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
-import com.xjrsoft.common.enums.*;
|
|
|
|
|
|
|
+import com.xjrsoft.common.enums.ArchivesStatusEnum;
|
|
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
|
|
+import com.xjrsoft.common.enums.EnabledMark;
|
|
|
|
|
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
|
|
|
|
|
+import com.xjrsoft.common.enums.RoleEnum;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.common.utils.RedisUtil;
|
|
import com.xjrsoft.common.utils.RedisUtil;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
@@ -17,7 +21,12 @@ import com.xjrsoft.module.banding.dto.AutomaticBandingTaskDto;
|
|
|
import com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto;
|
|
import com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto;
|
|
|
import com.xjrsoft.module.banding.dto.BandingTaskPageDto;
|
|
import com.xjrsoft.module.banding.dto.BandingTaskPageDto;
|
|
|
import com.xjrsoft.module.banding.dto.SureBandingTaskDto;
|
|
import com.xjrsoft.module.banding.dto.SureBandingTaskDto;
|
|
|
-import com.xjrsoft.module.banding.entity.*;
|
|
|
|
|
|
|
+import com.xjrsoft.module.banding.entity.BandingRule;
|
|
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTask;
|
|
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTaskClass;
|
|
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
|
|
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTaskMajorCondition;
|
|
|
|
|
+import com.xjrsoft.module.banding.entity.BandingTaskRule;
|
|
|
import com.xjrsoft.module.banding.mapper.BandingRuleMapper;
|
|
import com.xjrsoft.module.banding.mapper.BandingRuleMapper;
|
|
|
import com.xjrsoft.module.banding.mapper.BandingTaskClassMapper;
|
|
import com.xjrsoft.module.banding.mapper.BandingTaskClassMapper;
|
|
|
import com.xjrsoft.module.banding.mapper.BandingTaskMapper;
|
|
import com.xjrsoft.module.banding.mapper.BandingTaskMapper;
|
|
@@ -41,10 +50,21 @@ import com.xjrsoft.module.organization.entity.UserRoleRelation;
|
|
|
import com.xjrsoft.module.organization.service.IUserRoleRelationService;
|
|
import com.xjrsoft.module.organization.service.IUserRoleRelationService;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
import com.xjrsoft.module.outint.vo.IdCountVo;
|
|
import com.xjrsoft.module.outint.vo.IdCountVo;
|
|
|
-import com.xjrsoft.module.student.entity.*;
|
|
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseClassMajorSet;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseNewStudent;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentFamily;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.EnrollmentPlan;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.StudentReportPlan;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.StudentReportRecord;
|
|
|
import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
|
|
import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
|
|
|
import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
|
|
import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
|
|
|
-import com.xjrsoft.module.student.service.*;
|
|
|
|
|
|
|
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
|
|
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
|
|
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentService;
|
|
|
|
|
+import com.xjrsoft.module.student.service.IStudentReportPlanService;
|
|
|
import lombok.AllArgsConstructor;
|
|
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;
|
|
@@ -53,16 +73,23 @@ import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.*;
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.Collections;
|
|
|
|
|
+import java.util.Date;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
+import java.util.Random;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @title: 新生分班任务
|
|
|
|
|
- * @Author dzx
|
|
|
|
|
- * @Date: 2024-07-01
|
|
|
|
|
- * @Version 1.0
|
|
|
|
|
- */
|
|
|
|
|
|
|
+* @title: 新生分班任务
|
|
|
|
|
+* @Author dzx
|
|
|
|
|
+* @Date: 2024-07-01
|
|
|
|
|
+* @Version 1.0
|
|
|
|
|
+*/
|
|
|
@Service
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
|
public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper, BandingTask> implements IBandingTaskService {
|
|
public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper, BandingTask> implements IBandingTaskService {
|
|
@@ -128,7 +155,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean automaticBanding(AutomaticBandingTaskDto dto) {
|
|
public Boolean automaticBanding(AutomaticBandingTaskDto dto) {
|
|
|
BandingTask bandingTask = this.getById(dto.getBandingTaskId());
|
|
BandingTask bandingTask = this.getById(dto.getBandingTaskId());
|
|
|
- if (bandingTask == null) {
|
|
|
|
|
|
|
+ if(bandingTask == null){
|
|
|
throw new MyException("未能查询到该任务,无法自动分班");
|
|
throw new MyException("未能查询到该任务,无法自动分班");
|
|
|
}
|
|
}
|
|
|
//1、查询需要分班的学生信息
|
|
//1、查询需要分班的学生信息
|
|
@@ -157,7 +184,11 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
);
|
|
);
|
|
|
//2、查询所有班级信息
|
|
//2、查询所有班级信息
|
|
|
List<BandingTaskClass> classList = taskClassMapper.getListOrderByAsc(bandingTask.getId());
|
|
List<BandingTaskClass> classList = taskClassMapper.getListOrderByAsc(bandingTask.getId());
|
|
|
- if (!classList.isEmpty()) {
|
|
|
|
|
|
|
+ List<BandingTaskClass> nullNumberClass = classList.stream().filter(x -> x.getNumber() == null).collect(Collectors.toList());
|
|
|
|
|
+ if(!nullNumberClass.isEmpty()){
|
|
|
|
|
+ throw new MyException("班级配置中有班级未设置人数,无法自动分班");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!classList.isEmpty()){
|
|
|
//清除数据
|
|
//清除数据
|
|
|
List<Long> classIds = classList.stream().map(BandingTaskClass::getId).collect(Collectors.toList());
|
|
List<Long> classIds = classList.stream().map(BandingTaskClass::getId).collect(Collectors.toList());
|
|
|
classStudentService.remove(
|
|
classStudentService.remove(
|
|
@@ -185,12 +216,12 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
//计算每个专业平均的男女人数
|
|
//计算每个专业平均的男女人数
|
|
|
Map<Long, Integer> majorMaleCountMap = new HashMap<>();
|
|
Map<Long, Integer> majorMaleCountMap = new HashMap<>();
|
|
|
Map<Long, Integer> majorFemaleCountMap = new HashMap<>();
|
|
Map<Long, Integer> majorFemaleCountMap = new HashMap<>();
|
|
|
- if (ruleCodes.contains("BR0001")) {
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0001")){
|
|
|
for (Long majorSetId : majorClassCount.keySet()) {
|
|
for (Long majorSetId : majorClassCount.keySet()) {
|
|
|
int classCount = majorClassCount.get(majorSetId);
|
|
int classCount = majorClassCount.get(majorSetId);
|
|
|
Integer maleCount = majorStudentCountMap.get(majorSetId).getMaleCount();
|
|
Integer maleCount = majorStudentCountMap.get(majorSetId).getMaleCount();
|
|
|
Integer femaleCount = majorStudentCountMap.get(majorSetId).getFemaleCount();
|
|
Integer femaleCount = majorStudentCountMap.get(majorSetId).getFemaleCount();
|
|
|
- if (classCount == 1 || classCount == 0) {
|
|
|
|
|
|
|
+ if(classCount == 1 || classCount == 0){
|
|
|
majorMaleCountMap.put(majorSetId, maleCount);
|
|
majorMaleCountMap.put(majorSetId, maleCount);
|
|
|
majorFemaleCountMap.put(majorSetId, femaleCount);
|
|
majorFemaleCountMap.put(majorSetId, femaleCount);
|
|
|
continue;
|
|
continue;
|
|
@@ -202,7 +233,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
|
|
//包含下面个条件,则需要计算每个班级应该分配的人数
|
|
//包含下面个条件,则需要计算每个班级应该分配的人数
|
|
|
Map<Long, Integer> classLimitMap = new HashMap<>();
|
|
Map<Long, Integer> classLimitMap = new HashMap<>();
|
|
|
- if (ruleCodes.contains("BR0004")) {
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0004")){
|
|
|
//查询每个专业下面的班级人数
|
|
//查询每个专业下面的班级人数
|
|
|
Map<Long, Integer> majorClassStudentCount = taskClassMapper.getMajorClassStudentCount(bandingTask.getId())
|
|
Map<Long, Integer> majorClassStudentCount = taskClassMapper.getMajorClassStudentCount(bandingTask.getId())
|
|
|
.stream().collect(Collectors.toMap(IdCountVo::getId, IdCountVo::getCount));
|
|
.stream().collect(Collectors.toMap(IdCountVo::getId, IdCountVo::getCount));
|
|
@@ -212,21 +243,21 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
Map<Long, Integer> majorLimitMap = new HashMap<>();
|
|
Map<Long, Integer> majorLimitMap = new HashMap<>();
|
|
|
for (Long majorSetId : majorClassStudentCount.keySet()) {
|
|
for (Long majorSetId : majorClassStudentCount.keySet()) {
|
|
|
int majorClassNumber = 0;
|
|
int majorClassNumber = 0;
|
|
|
- if (majorClassStudentCount.get(majorSetId) != null) {
|
|
|
|
|
|
|
+ if(majorClassStudentCount.get(majorSetId) != null){
|
|
|
majorClassNumber = majorClassStudentCount.get(majorSetId);
|
|
majorClassNumber = majorClassStudentCount.get(majorSetId);
|
|
|
}
|
|
}
|
|
|
- if (majorClassCount.get(majorSetId) == 1 || majorClassCount.get(majorSetId) == 0) {
|
|
|
|
|
|
|
+ if(majorClassCount.get(majorSetId) == 1 || majorClassCount.get(majorSetId) == 0){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
int majorStudentNumber = 0;
|
|
int majorStudentNumber = 0;
|
|
|
- if (majorStudentCount.get(majorSetId) != null) {
|
|
|
|
|
|
|
+ if(majorStudentCount.get(majorSetId) != null){
|
|
|
majorStudentNumber = majorStudentCount.get(majorSetId);
|
|
majorStudentNumber = majorStudentCount.get(majorSetId);
|
|
|
}
|
|
}
|
|
|
Integer classCount = majorClassCount.get(majorSetId);
|
|
Integer classCount = majorClassCount.get(majorSetId);
|
|
|
- if (majorStudentNumber < majorClassNumber) {//报名人数小于班级人数
|
|
|
|
|
|
|
+ if(majorStudentNumber < majorClassNumber){//报名人数小于班级人数
|
|
|
Integer classLimtCount = majorStudentNumber / classCount;
|
|
Integer classLimtCount = majorStudentNumber / classCount;
|
|
|
majorLimitMap.put(majorSetId, classLimtCount);
|
|
majorLimitMap.put(majorSetId, classLimtCount);
|
|
|
- } else {
|
|
|
|
|
|
|
+ }else{
|
|
|
Integer classLimtCount = majorClassNumber / classCount;
|
|
Integer classLimtCount = majorClassNumber / classCount;
|
|
|
majorLimitMap.put(majorSetId, classLimtCount);
|
|
majorLimitMap.put(majorSetId, classLimtCount);
|
|
|
}
|
|
}
|
|
@@ -248,7 +279,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
|
|
Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
|
|
|
- if (ruleCodes.contains("BR0002")) {
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0002")){
|
|
|
classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList));
|
|
classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -258,32 +289,32 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
//4、开始分班
|
|
//4、开始分班
|
|
|
for (BandingTaskClass taskClass : classList) {
|
|
for (BandingTaskClass taskClass : classList) {
|
|
|
Integer number = taskClass.getNumber();//班级总人数
|
|
Integer number = taskClass.getNumber();//班级总人数
|
|
|
- if (classLimitMap.get(taskClass.getId()) != null) {
|
|
|
|
|
- if (number > classLimitMap.get(taskClass.getId())) {
|
|
|
|
|
|
|
+ if(classLimitMap.get(taskClass.getId()) != null){
|
|
|
|
|
+ if(number > classLimitMap.get(taskClass.getId())){
|
|
|
number = classLimitMap.get(taskClass.getId());
|
|
number = classLimitMap.get(taskClass.getId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Integer maleCount = 0, femaleCount = 0;
|
|
Integer maleCount = 0, femaleCount = 0;
|
|
|
- if (ruleCodes.contains("BR0001")) {
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0001")){
|
|
|
IdManyCountVo countVo = majorStudentCountMap.get(taskClass.getMajorSetId());
|
|
IdManyCountVo countVo = majorStudentCountMap.get(taskClass.getMajorSetId());
|
|
|
maleCount = number / 2;
|
|
maleCount = number / 2;
|
|
|
femaleCount = number / 2;
|
|
femaleCount = number / 2;
|
|
|
//如果班级人数是奇数,随机分配一个名额
|
|
//如果班级人数是奇数,随机分配一个名额
|
|
|
- if (number % 2 != 0) {
|
|
|
|
|
|
|
+ if(number % 2 != 0){
|
|
|
Random random = new Random();
|
|
Random random = new Random();
|
|
|
int randomIndex = random.nextInt(GenderDictionaryEnum.getCodes().length);
|
|
int randomIndex = random.nextInt(GenderDictionaryEnum.getCodes().length);
|
|
|
|
|
|
|
|
String randomGender = GenderDictionaryEnum.getCodes()[randomIndex];
|
|
String randomGender = GenderDictionaryEnum.getCodes()[randomIndex];
|
|
|
- if (GenderDictionaryEnum.MALE.getCode().equals(randomGender)) {
|
|
|
|
|
- maleCount++;
|
|
|
|
|
- } else if (GenderDictionaryEnum.FEMALE.getCode().equals(randomGender)) {
|
|
|
|
|
- femaleCount++;
|
|
|
|
|
|
|
+ if(GenderDictionaryEnum.MALE.getCode().equals(randomGender)){
|
|
|
|
|
+ maleCount ++;
|
|
|
|
|
+ }else if(GenderDictionaryEnum.FEMALE.getCode().equals(randomGender)){
|
|
|
|
|
+ femaleCount ++ ;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (majorMaleCountMap.get(taskClass.getMajorSetId()) < maleCount) {
|
|
|
|
|
|
|
+ if(majorMaleCountMap.get(taskClass.getMajorSetId()) < maleCount){
|
|
|
maleCount = countVo.getMaleCount();
|
|
maleCount = countVo.getMaleCount();
|
|
|
femaleCount = number - maleCount;
|
|
femaleCount = number - maleCount;
|
|
|
- } else if (majorFemaleCountMap.get(taskClass.getMajorSetId()) < femaleCount) {
|
|
|
|
|
|
|
+ }else if(majorFemaleCountMap.get(taskClass.getMajorSetId()) < femaleCount){
|
|
|
femaleCount = countVo.getFemaleCount();
|
|
femaleCount = countVo.getFemaleCount();
|
|
|
maleCount = number - femaleCount;
|
|
maleCount = number - femaleCount;
|
|
|
}
|
|
}
|
|
@@ -294,68 +325,68 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
|
|
List<BaseNewStudent> studentList = new ArrayList<>();
|
|
List<BaseNewStudent> studentList = new ArrayList<>();
|
|
|
studentList.addAll(baseNewStudents);
|
|
studentList.addAll(baseNewStudents);
|
|
|
- if (ruleCodes.contains("BR0002") && classStudentMap.get(taskClass.getMajorSetId()) != null && !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()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (BaseNewStudent newStudent : studentList) {
|
|
for (BaseNewStudent newStudent : studentList) {
|
|
|
//人数已满,进行下一个班级的的循环
|
|
//人数已满,进行下一个班级的的循环
|
|
|
- if (nameList.size() == number) {
|
|
|
|
|
|
|
+ if(nameList.size() == number){
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
//该学生已被分配
|
|
//该学生已被分配
|
|
|
- if (studentClassMap.containsKey(newStudent.getId())) {
|
|
|
|
|
|
|
+ if(studentClassMap.containsKey(newStudent.getId())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- if (ruleCodes.contains("BR0003") && nameList.contains(newStudent.getName())) {
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0003") && nameList.contains(newStudent.getName())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
//专业不匹配,直接跳过
|
|
//专业不匹配,直接跳过
|
|
|
- if (!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())) {
|
|
|
|
|
|
|
+ if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
//判断该班性别是否已满,如果设置了排序,即使性别满了班级人数没满继续分班
|
|
//判断该班性别是否已满,如果设置了排序,即使性别满了班级人数没满继续分班
|
|
|
- if (ruleCodes.contains("BR0001")) {
|
|
|
|
|
- if (GenderDictionaryEnum.MALE.getCode().equals(newStudent.getGender()) && maleList.size() == maleCount) {
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0001")){
|
|
|
|
|
+ if(GenderDictionaryEnum.MALE.getCode().equals(newStudent.getGender()) && maleList.size() == maleCount){
|
|
|
continue;
|
|
continue;
|
|
|
- } else if (GenderDictionaryEnum.FEMALE.getCode().equals(newStudent.getGender()) && femaleList.size() == femaleCount) {
|
|
|
|
|
|
|
+ }else if(GenderDictionaryEnum.FEMALE.getCode().equals(newStudent.getGender()) && femaleList.size() == femaleCount){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (taskClass.getSortCode() == null && !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId())) {//如果未给班级设置优先级,只匹配一志愿的学生
|
|
|
|
|
|
|
+ if(taskClass.getSortCode() == null && !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId())){//如果未给班级设置优先级,只匹配一志愿的学生
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Boolean> conditionList = new ArrayList<>();
|
|
List<Boolean> conditionList = new ArrayList<>();
|
|
|
BandingTaskMajorCondition condition = classConditionMap.get(taskClass.getMajorSetId());
|
|
BandingTaskMajorCondition condition = classConditionMap.get(taskClass.getMajorSetId());
|
|
|
- if (condition != null) {
|
|
|
|
|
- if (condition.getHeight() != null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0) {
|
|
|
|
|
|
|
+ if(condition != null){
|
|
|
|
|
+ if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0 ){
|
|
|
conditionList.add(true);
|
|
conditionList.add(true);
|
|
|
- } else if (condition.getHeight() != null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0) {
|
|
|
|
|
|
|
+ }else if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
- } else if (condition.getHeight() != null && newStudent.getHeight() == null) {
|
|
|
|
|
|
|
+ }else if(condition.getHeight() !=null && newStudent.getHeight() == null){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (condition.getScore() != null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0) {
|
|
|
|
|
|
|
+ if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0 ){
|
|
|
conditionList.add(true);
|
|
conditionList.add(true);
|
|
|
- } else if (condition.getScore() != null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0) {
|
|
|
|
|
|
|
+ }else if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
- } else if (condition.getScore() != null && newStudent.getScore() == null) {
|
|
|
|
|
|
|
+ }else if(condition.getScore() !=null && newStudent.getScore() == null){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//如果包含false,则表明不符合条件,这个学生跳过
|
|
//如果包含false,则表明不符合条件,这个学生跳过
|
|
|
- if (conditionList.contains(false)) {
|
|
|
|
|
|
|
+ if(conditionList.contains(false)){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
studentClassMap.put(newStudent.getId(), taskClass.getId());
|
|
studentClassMap.put(newStudent.getId(), taskClass.getId());
|
|
|
- if (GenderDictionaryEnum.MALE.getCode().equals(newStudent.getGender())) {
|
|
|
|
|
|
|
+ if(GenderDictionaryEnum.MALE.getCode().equals(newStudent.getGender())){
|
|
|
maleList.add(newStudent);
|
|
maleList.add(newStudent);
|
|
|
- } else if (GenderDictionaryEnum.FEMALE.getCode().equals(newStudent.getGender())) {
|
|
|
|
|
|
|
+ }else if(GenderDictionaryEnum.FEMALE.getCode().equals(newStudent.getGender())){
|
|
|
femaleList.add(newStudent);
|
|
femaleList.add(newStudent);
|
|
|
}
|
|
}
|
|
|
nameList.add(newStudent.getName());
|
|
nameList.add(newStudent.getName());
|
|
@@ -365,54 +396,54 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
// 4.1、二次循环班级,对没有设置排序的班级进行分班,
|
|
// 4.1、二次循环班级,对没有设置排序的班级进行分班,
|
|
|
for (BandingTaskClass taskClass : classList) {
|
|
for (BandingTaskClass taskClass : classList) {
|
|
|
Integer number = taskClass.getNumber();//班级总人数
|
|
Integer number = taskClass.getNumber();//班级总人数
|
|
|
- if (classLimitMap.get(taskClass.getId()) != null) {
|
|
|
|
|
- if (number > classLimitMap.get(taskClass.getId())) {
|
|
|
|
|
|
|
+ if(classLimitMap.get(taskClass.getId()) != null){
|
|
|
|
|
+ if(number > classLimitMap.get(taskClass.getId())){
|
|
|
number = classLimitMap.get(taskClass.getId());
|
|
number = classLimitMap.get(taskClass.getId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
List<String> nameList = classNameMap.get(taskClass.getId());
|
|
List<String> nameList = classNameMap.get(taskClass.getId());
|
|
|
- if (nameList.size() == number) {
|
|
|
|
|
|
|
+ if(nameList.size() == number){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
for (BaseNewStudent newStudent : baseNewStudents) {
|
|
for (BaseNewStudent newStudent : baseNewStudents) {
|
|
|
//人数已满,进行下一个班级的的循环
|
|
//人数已满,进行下一个班级的的循环
|
|
|
- if (nameList.size() == number) {
|
|
|
|
|
|
|
+ if(nameList.size() == number){
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
//该学生已被分配
|
|
//该学生已被分配
|
|
|
- if (studentClassMap.containsKey(newStudent.getId())) {
|
|
|
|
|
|
|
+ if(studentClassMap.containsKey(newStudent.getId())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- if (ruleCodes.contains("BR0003") && nameList.contains(newStudent.getName())) {
|
|
|
|
|
|
|
+ if(ruleCodes.contains("BR0003") && nameList.contains(newStudent.getName())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
//专业不匹配,直接跳过
|
|
//专业不匹配,直接跳过
|
|
|
- if (!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())) {
|
|
|
|
|
|
|
+ if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
//判断该班性别是否已满
|
|
//判断该班性别是否已满
|
|
|
List<Boolean> conditionList = new ArrayList<>();
|
|
List<Boolean> conditionList = new ArrayList<>();
|
|
|
BandingTaskMajorCondition condition = classConditionMap.get(taskClass.getMajorSetId());
|
|
BandingTaskMajorCondition condition = classConditionMap.get(taskClass.getMajorSetId());
|
|
|
- if (condition != null) {
|
|
|
|
|
- if (condition.getHeight() != null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0) {
|
|
|
|
|
|
|
+ if(condition != null){
|
|
|
|
|
+ if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0 ){
|
|
|
conditionList.add(true);
|
|
conditionList.add(true);
|
|
|
- } else if (condition.getHeight() != null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0) {
|
|
|
|
|
|
|
+ }else if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
- } else if (condition.getHeight() != null && newStudent.getHeight() == null) {
|
|
|
|
|
|
|
+ }else if(condition.getHeight() !=null && newStudent.getHeight() == null){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (condition.getScore() != null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0) {
|
|
|
|
|
|
|
+ if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0 ){
|
|
|
conditionList.add(true);
|
|
conditionList.add(true);
|
|
|
- } else if (condition.getScore() != null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0) {
|
|
|
|
|
|
|
+ }else if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
- } else if (condition.getScore() != null && newStudent.getScore() == null) {
|
|
|
|
|
|
|
+ }else if(condition.getScore() !=null && newStudent.getScore() == null){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//如果包含false,则表明不符合条件,这个学生跳过
|
|
//如果包含false,则表明不符合条件,这个学生跳过
|
|
|
- if (conditionList.contains(false)) {
|
|
|
|
|
|
|
+ if(conditionList.contains(false)){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
studentClassMap.put(newStudent.getId(), taskClass.getId());
|
|
studentClassMap.put(newStudent.getId(), taskClass.getId());
|
|
@@ -425,7 +456,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
Date createDate = new Date();
|
|
Date createDate = new Date();
|
|
|
for (Long studentId : studentClassMap.keySet()) {
|
|
for (Long studentId : studentClassMap.keySet()) {
|
|
|
dataList.add(
|
|
dataList.add(
|
|
|
- new BandingTaskClassStudent() {{
|
|
|
|
|
|
|
+ new BandingTaskClassStudent(){{
|
|
|
setBandingTaskClassId(studentClassMap.get(studentId));
|
|
setBandingTaskClassId(studentClassMap.get(studentId));
|
|
|
setNewStudentId(studentId);
|
|
setNewStudentId(studentId);
|
|
|
setStatus(0);
|
|
setStatus(0);
|
|
@@ -433,7 +464,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
}}
|
|
}}
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
|
|
|
|
+ if(!dataList.isEmpty()){
|
|
|
classStudentService.saveBatch(dataList);
|
|
classStudentService.saveBatch(dataList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -442,11 +473,10 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 按照成绩均衡划分学生
|
|
* 按照成绩均衡划分学生
|
|
|
- *
|
|
|
|
|
* @return 班级id和学生
|
|
* @return 班级id和学生
|
|
|
*/
|
|
*/
|
|
|
Map<Long, List<BaseNewStudent>> divideStudentByScore(Map<Long, BandingTaskMajorCondition> classConditionMap, List<BaseNewStudent> baseNewStudents,
|
|
Map<Long, List<BaseNewStudent>> divideStudentByScore(Map<Long, BandingTaskMajorCondition> classConditionMap, List<BaseNewStudent> baseNewStudents,
|
|
|
- List<BandingTaskClass> classList) {
|
|
|
|
|
|
|
+ List<BandingTaskClass> classList){
|
|
|
Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
|
|
Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
|
|
|
for (Long majorSetId : classConditionMap.keySet()) {
|
|
for (Long majorSetId : classConditionMap.keySet()) {
|
|
|
//查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
|
|
//查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
|
|
@@ -454,7 +484,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
for (int i = 0; i < classList.size(); i++) {
|
|
for (int i = 0; i < classList.size(); i++) {
|
|
|
result.add(new ArrayList<>());
|
|
result.add(new ArrayList<>());
|
|
|
}
|
|
}
|
|
|
- if (result.size() == 1) {
|
|
|
|
|
|
|
+ if(result.size() == 1){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -462,36 +492,36 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
List<BaseNewStudent> stuList = new ArrayList<>();
|
|
List<BaseNewStudent> stuList = new ArrayList<>();
|
|
|
|
|
|
|
|
for (BaseNewStudent newStudent : baseNewStudents) {
|
|
for (BaseNewStudent newStudent : baseNewStudents) {
|
|
|
- if (!Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) && !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())) {
|
|
|
|
|
|
|
+ if(!Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) && !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Boolean> conditionList = new ArrayList<>();
|
|
List<Boolean> conditionList = new ArrayList<>();
|
|
|
BandingTaskMajorCondition condition = classConditionMap.get(majorSetId);
|
|
BandingTaskMajorCondition condition = classConditionMap.get(majorSetId);
|
|
|
- if (condition.getHeight() != null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0) {
|
|
|
|
|
|
|
+ if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) >= 0 ){
|
|
|
conditionList.add(true);
|
|
conditionList.add(true);
|
|
|
- } else if (condition.getHeight() != null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0) {
|
|
|
|
|
|
|
+ }else if(condition.getHeight() !=null && newStudent.getHeight() != null && newStudent.getHeight().compareTo(condition.getHeight()) < 0){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
- } else if (condition.getHeight() != null && newStudent.getHeight() == null) {
|
|
|
|
|
|
|
+ }else if(condition.getHeight() !=null && newStudent.getHeight() == null){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (condition.getScore() != null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0) {
|
|
|
|
|
|
|
+ if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) >= 0 ){
|
|
|
conditionList.add(true);
|
|
conditionList.add(true);
|
|
|
- } else if (condition.getScore() != null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0) {
|
|
|
|
|
|
|
+ }else if(condition.getScore() !=null && newStudent.getScore() != null && newStudent.getScore().compareTo(condition.getScore()) < 0){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
- } else if (condition.getScore() != null && newStudent.getScore() == null) {
|
|
|
|
|
|
|
+ }else if(condition.getScore() !=null && newStudent.getScore() == null){
|
|
|
conditionList.add(false);
|
|
conditionList.add(false);
|
|
|
}
|
|
}
|
|
|
//如果包含false,则表明不符合条件,这个学生跳过
|
|
//如果包含false,则表明不符合条件,这个学生跳过
|
|
|
- if (conditionList.contains(false)) {
|
|
|
|
|
|
|
+ if(conditionList.contains(false)){
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
stuList.add(newStudent);
|
|
stuList.add(newStudent);
|
|
|
}
|
|
}
|
|
|
- if (!stuList.isEmpty()) {
|
|
|
|
|
|
|
+ if(!stuList.isEmpty()){
|
|
|
for (BaseNewStudent student : stuList) {
|
|
for (BaseNewStudent student : stuList) {
|
|
|
- if (student.getScore() == null) {
|
|
|
|
|
|
|
+ if(student.getScore() == null){
|
|
|
student.setScore(BigDecimal.ZERO);
|
|
student.setScore(BigDecimal.ZERO);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -504,7 +534,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
result.get(classIndex).add(currentStudent);
|
|
result.get(classIndex).add(currentStudent);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for (int i = 0; i < result.size(); i++) {
|
|
|
|
|
|
|
+ for (int i = 0; i < result.size(); i ++){
|
|
|
classStudentMap.put(classList.get(i).getId(), result.get(i));
|
|
classStudentMap.put(classList.get(i).getId(), result.get(i));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -527,7 +557,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
.eq(BandingTaskClassStudent::getStatus, 0)
|
|
.eq(BandingTaskClassStudent::getStatus, 0)
|
|
|
);
|
|
);
|
|
|
List<Long> studentIds = classStudents.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
|
|
List<Long> studentIds = classStudents.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
|
|
|
- if (studentIds.isEmpty()) {
|
|
|
|
|
|
|
+ if(studentIds.isEmpty()){
|
|
|
throw new MyException("未能查询到学生,无法确认");
|
|
throw new MyException("未能查询到学生,无法确认");
|
|
|
}
|
|
}
|
|
|
List<BaseNewStudent> list = newStudentService.list(
|
|
List<BaseNewStudent> list = newStudentService.list(
|
|
@@ -540,7 +570,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
updateList.add(student);
|
|
updateList.add(student);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!updateList.isEmpty()) {
|
|
|
|
|
|
|
+ if(!updateList.isEmpty()){
|
|
|
newStudentService.updateBatchById(updateList);
|
|
newStudentService.updateBatchById(updateList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -578,7 +608,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
setClassroomId(taskClass.getClassroomId());
|
|
setClassroomId(taskClass.getClassroomId());
|
|
|
setTeacherId(taskClass.getTeacherId());
|
|
setTeacherId(taskClass.getTeacherId());
|
|
|
setIsGraduate(1);
|
|
setIsGraduate(1);
|
|
|
- setIsOrderClass(taskClass.getIsOrderClass() == null ? 0 : taskClass.getIsOrderClass().intValue());
|
|
|
|
|
|
|
+ setIsOrderClass(taskClass.getIsOrderClass()==null?0:taskClass.getIsOrderClass().intValue());
|
|
|
setGradeId(bandingTask.getGradeId());
|
|
setGradeId(bandingTask.getGradeId());
|
|
|
setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
setEnrollType(bandingTask.getEnrollType());
|
|
setEnrollType(bandingTask.getEnrollType());
|
|
@@ -603,7 +633,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
|
|
classMap.put(taskClass.getId(), baseClass.getId());
|
|
classMap.put(taskClass.getId(), baseClass.getId());
|
|
|
taskClassMajorMap.put(taskClass.getId(), taskClass.getMajorSetId());
|
|
taskClassMajorMap.put(taskClass.getId(), taskClass.getMajorSetId());
|
|
|
- maxCode++;
|
|
|
|
|
|
|
+ maxCode ++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -650,7 +680,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
|
|
BaseStudentSchoolRoll schoolRoll = new BaseStudentSchoolRoll() {{
|
|
BaseStudentSchoolRoll schoolRoll = new BaseStudentSchoolRoll() {{
|
|
|
setUserId(xjrUser.getId());
|
|
setUserId(xjrUser.getId());
|
|
|
- if (student.getScore() != null) {
|
|
|
|
|
|
|
+ if(student.getScore() != null){
|
|
|
setGraduatedScore(student.getScore().doubleValue());
|
|
setGraduatedScore(student.getScore().doubleValue());
|
|
|
}
|
|
}
|
|
|
setGraduatedUniversity(student.getGraduateSchool());
|
|
setGraduatedUniversity(student.getGraduateSchool());
|
|
@@ -698,7 +728,6 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 确认分班后,进入
|
|
* 确认分班后,进入
|
|
|
- *
|
|
|
|
|
* @param dto
|
|
* @param dto
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -714,7 +743,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
.eq(BandingTaskClass::getBandingTaskId, dto.getId())
|
|
.eq(BandingTaskClass::getBandingTaskId, dto.getId())
|
|
|
);
|
|
);
|
|
|
List<Long> studentIds = classStudents.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
|
|
List<Long> studentIds = classStudents.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
|
|
|
- if (studentIds.isEmpty()) {
|
|
|
|
|
|
|
+ if(studentIds.isEmpty()){
|
|
|
throw new MyException("未能查询到学生,无法确认");
|
|
throw new MyException("未能查询到学生,无法确认");
|
|
|
}
|
|
}
|
|
|
BandingTask bandingTask = this.getById(dto.getId());
|
|
BandingTask bandingTask = this.getById(dto.getId());
|
|
@@ -730,7 +759,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
updateList.add(student);
|
|
updateList.add(student);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!updateList.isEmpty()) {
|
|
|
|
|
|
|
+ if(!updateList.isEmpty()){
|
|
|
newStudentService.updateBatchById(updateList);
|
|
newStudentService.updateBatchById(updateList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -742,8 +771,9 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
.eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
.eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
|
.eq(StudentReportPlan::getSemesterId, semester.getId())
|
|
.eq(StudentReportPlan::getSemesterId, semester.getId())
|
|
|
.eq(StudentReportPlan::getCategory, 2)
|
|
.eq(StudentReportPlan::getCategory, 2)
|
|
|
|
|
+ .eq(StudentReportPlan::getBandingTaskId, dto.getBandingTaskId())
|
|
|
);
|
|
);
|
|
|
- if (plan == null) {
|
|
|
|
|
|
|
+ if(plan == null){
|
|
|
plan = new StudentReportPlan() {{
|
|
plan = new StudentReportPlan() {{
|
|
|
setName(bandingTask.getName());
|
|
setName(bandingTask.getName());
|
|
|
setCategory(2);
|
|
setCategory(2);
|
|
@@ -770,12 +800,13 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
bandingTask.setStatus(1);
|
|
bandingTask.setStatus(1);
|
|
|
bandingTask.setModifyDate(new Date());
|
|
bandingTask.setModifyDate(new Date());
|
|
|
return this.update(bandingTask);
|
|
return this.update(bandingTask);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- LocalDate getBirthDate(String idCardNumber) {
|
|
|
|
|
|
|
+ LocalDate getBirthDate(String idCardNumber){
|
|
|
// 获取出生日期前6位,即yyyyMM
|
|
// 获取出生日期前6位,即yyyyMM
|
|
|
String birthdayString = idCardNumber.substring(6, 14);
|
|
String birthdayString = idCardNumber.substring(6, 14);
|
|
|
|
|
|
|
@@ -785,20 +816,18 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
try {
|
|
try {
|
|
|
LocalDate parse = LocalDate.parse(birthdayString, formatter);
|
|
LocalDate parse = LocalDate.parse(birthdayString, formatter);
|
|
|
return parse;
|
|
return parse;
|
|
|
- } catch (Exception e) {
|
|
|
|
|
|
|
+ }catch (Exception e){
|
|
|
throw new MyException("身份证号填写错误,无法提取出生日期");
|
|
throw new MyException("身份证号填写错误,无法提取出生日期");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 修改新生信息中的状态和分班类型
|
|
* 修改新生信息中的状态和分班类型
|
|
|
- *
|
|
|
|
|
- * @param bandingTaskId 分班任务id
|
|
|
|
|
- * @param operateMode 分班类型(1:自动分班 2:手动分班)
|
|
|
|
|
|
|
+ * @param bandingTaskId 分班任务id
|
|
|
|
|
+ * @param operateMode 分班类型(1:自动分班 2:手动分班)
|
|
|
* @param baseNewStudentId 新生id,适合手动调整班级时调用
|
|
* @param baseNewStudentId 新生id,适合手动调整班级时调用
|
|
|
*/
|
|
*/
|
|
|
- void updateBaseNewStudentStatus(Long bandingTaskId, Integer operateMode, Long baseNewStudentId) {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ void updateBaseNewStudentStatus(Long bandingTaskId, Integer operateMode, Long baseNewStudentId){
|
|
|
|
|
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|