|
|
@@ -1,6 +1,7 @@
|
|
|
package com.xjrsoft.module.banding.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -519,7 +520,6 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
result.get(classIndex).add(currentStudent);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
for (int i = 0; i < result.size(); i ++){
|
|
|
classStudentMap.put(classList.get(i).getId(), result.get(i));
|
|
|
}
|
|
|
@@ -720,11 +720,8 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Boolean sureReport(SureBandingTaskDto dto) {
|
|
|
- List<BandingTaskClassStudent> list = classStudentService.list(
|
|
|
- new MPJLambdaWrapper<BandingTaskClassStudent>()
|
|
|
- .innerJoin(BandingTaskClass.class, BandingTaskClass::getId, BandingTaskClassStudent::getBandingTaskClassId)
|
|
|
- .eq(BandingTaskClass::getBandingTaskId, dto.getBandingTaskId())
|
|
|
- );
|
|
|
+ //修改新生信息中的状态
|
|
|
+ updateBaseNewStudentStatus(dto.getBandingTaskId(), 1, null);
|
|
|
|
|
|
BandingTask bandingTask = this.getById(dto.getId());
|
|
|
bandingTask.setStatus(1);
|
|
|
@@ -747,4 +744,37 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
throw new MyException("身份证号填写错误,无法提取出生日期");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改新生信息中的状态和分班类型
|
|
|
+ * @param bandingTaskId 分班任务id
|
|
|
+ * @param operateMode 分班类型(1:自动分班 2:手动分班)
|
|
|
+ * @param baseNewStudentId 新生id,适合手动调整班级时调用
|
|
|
+ */
|
|
|
+ void updateBaseNewStudentStatus(Long bandingTaskId, Integer operateMode, Long baseNewStudentId){
|
|
|
+ List<BandingTaskClassStudent> classStudents = classStudentService.list(
|
|
|
+ new MPJLambdaWrapper<BandingTaskClassStudent>()
|
|
|
+ .innerJoin(BandingTaskClass.class, BandingTaskClass::getId, BandingTaskClassStudent::getBandingTaskClassId)
|
|
|
+ .eq(BandingTaskClass::getBandingTaskId, bandingTaskId)
|
|
|
+ .eq(ObjectUtil.isNotNull(baseNewStudentId), BandingTaskClassStudent::getNewStudentId, baseNewStudentId)
|
|
|
+ );
|
|
|
+ List<Long> studentIds = classStudents.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
|
|
|
+ if(studentIds.isEmpty()){
|
|
|
+ throw new MyException("未能查询到学生,无法确认");
|
|
|
+ }
|
|
|
+ List<BaseNewStudent> list = newStudentService.list(
|
|
|
+ new QueryWrapper<BaseNewStudent>().lambda()
|
|
|
+ .in(BaseNewStudent::getId, studentIds)
|
|
|
+ );
|
|
|
+ List<BaseNewStudent> updateList = new ArrayList<>();
|
|
|
+ for (BaseNewStudent student : list) {
|
|
|
+ student.setStatus(1);
|
|
|
+ student.setOperateMode(operateMode);
|
|
|
+ updateList.add(student);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!updateList.isEmpty()){
|
|
|
+ newStudentService.updateBatchById(updateList);
|
|
|
+ }
|
|
|
+ };
|
|
|
}
|