|
|
@@ -1,6 +1,7 @@
|
|
|
package com.xjrsoft.module.banding.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -53,11 +54,14 @@ 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.StudentReportRecord;
|
|
|
import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
|
|
|
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.IStudentChangeRecordService;
|
|
|
+import com.xjrsoft.module.student.service.IStudentReportRecordService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -105,6 +109,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
private final IBaseGradeService gradeService;
|
|
|
private final BaseMajorSetMapper majorSetMapper;
|
|
|
private final RedisUtil redisUtil;
|
|
|
+ private final IStudentReportRecordService reportRecordService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -157,7 +162,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
);
|
|
|
List<Long> studentIds = classStudents.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
|
|
|
|
|
|
- List<String> orderColumn = new ArrayList();
|
|
|
+ List<String> orderColumn = new ArrayList<>();
|
|
|
orderColumn.add("score");
|
|
|
List<BaseNewStudent> baseNewStudents = newStudentService.selectJoinList(BaseNewStudent.class,
|
|
|
new MPJLambdaWrapper<BaseNewStudent>()
|
|
|
@@ -519,7 +524,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,7 +724,49 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Boolean sureReport(SureBandingTaskDto dto) {
|
|
|
- return null;
|
|
|
+ //修改新生信息中的状态
|
|
|
+ List<BandingTaskClassStudent> classStudents = classStudentService.list(
|
|
|
+ new MPJLambdaWrapper<BandingTaskClassStudent>()
|
|
|
+ .innerJoin(BandingTaskClass.class, BandingTaskClass::getId, BandingTaskClassStudent::getBandingTaskClassId)
|
|
|
+ .eq(BandingTaskClass::getBandingTaskId, dto.getBandingTaskId())
|
|
|
+ );
|
|
|
+ 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(1);
|
|
|
+ updateList.add(student);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!updateList.isEmpty()){
|
|
|
+ newStudentService.updateBatchById(updateList);
|
|
|
+ }
|
|
|
+
|
|
|
+ //将新生数据初始化到报到表中
|
|
|
+ List<StudentReportRecord> insertList = new ArrayList<>();
|
|
|
+ for (BaseNewStudent student : updateList) {
|
|
|
+ insertList.add(
|
|
|
+ new StudentReportRecord(){{
|
|
|
+ setCreateDate(new Date());
|
|
|
+ setCreateUserId(StpUtil.getLoginIdAsLong());
|
|
|
+ setUserId(student.getId());
|
|
|
+ setBandingTaskId(dto.getBandingTaskId());
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
+ reportRecordService.saveBatch(insertList);
|
|
|
+
|
|
|
+ BandingTask bandingTask = this.getById(dto.getId());
|
|
|
+ bandingTask.setStatus(1);
|
|
|
+ bandingTask.setModifyDate(new Date());
|
|
|
+ return this.update(bandingTask);
|
|
|
}
|
|
|
|
|
|
LocalDate getBirthDate(String idCardNumber){
|
|
|
@@ -737,4 +783,14 @@ 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){
|
|
|
+
|
|
|
+ };
|
|
|
}
|