|
@@ -1,7 +1,7 @@
|
|
|
package com.xjrsoft.module.banding.service.impl;
|
|
package com.xjrsoft.module.banding.service.impl;
|
|
|
|
|
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -54,11 +54,14 @@ import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentFamily;
|
|
import com.xjrsoft.module.student.entity.BaseStudentFamily;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
import com.xjrsoft.module.student.entity.EnrollmentPlan;
|
|
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.mapper.BaseClassMajorSetMapper;
|
|
|
import com.xjrsoft.module.student.service.IBaseNewStudentService;
|
|
import com.xjrsoft.module.student.service.IBaseNewStudentService;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
|
|
import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentService;
|
|
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 lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -106,6 +109,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
private final IBaseGradeService gradeService;
|
|
private final IBaseGradeService gradeService;
|
|
|
private final BaseMajorSetMapper majorSetMapper;
|
|
private final BaseMajorSetMapper majorSetMapper;
|
|
|
private final RedisUtil redisUtil;
|
|
private final RedisUtil redisUtil;
|
|
|
|
|
+ private final IStudentReportRecordService reportRecordService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -721,7 +725,43 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public Boolean sureReport(SureBandingTaskDto dto) {
|
|
public Boolean sureReport(SureBandingTaskDto dto) {
|
|
|
//修改新生信息中的状态
|
|
//修改新生信息中的状态
|
|
|
- updateBaseNewStudentStatus(dto.getBandingTaskId(), 1, 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 bandingTask = this.getById(dto.getId());
|
|
|
bandingTask.setStatus(1);
|
|
bandingTask.setStatus(1);
|
|
@@ -752,29 +792,6 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
|
|
|
* @param baseNewStudentId 新生id,适合手动调整班级时调用
|
|
* @param baseNewStudentId 新生id,适合手动调整班级时调用
|
|
|
*/
|
|
*/
|
|
|
void updateBaseNewStudentStatus(Long bandingTaskId, Integer operateMode, Long baseNewStudentId){
|
|
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);
|
|
|
|
|
- }
|
|
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|