This commit is contained in:
XiuHe 2026-03-06 19:52:49 +08:00
commit 75db8b128a
1 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
@Service
public class StudentServiceImpl extends ServiceImpl<StudentInfoMapper, StudentInfo> implements IStudentInfoService {
@ -38,8 +39,13 @@ public class StudentServiceImpl extends ServiceImpl<StudentInfoMapper, StudentIn
Long studentId = baseInfo.getStudentId();
Long studentBaseId = baseInfo.getStudentBaseId();
StudentInfo existingStudentInfo = studentInfoMapper.selectById(studentId);
Date preservedPreRegistrationTime = existingStudentInfo != null ? existingStudentInfo.getPreRegistrationTime() : null;
studentInfo.setStudentId(studentId);
studentBaseInfo.setStudentBaseId(studentBaseId);
// 保留原有预报名时间若之前未设置则用当前时间
studentInfo.setPreRegistrationTime(preservedPreRegistrationTime != null ? preservedPreRegistrationTime : new Date());
studentInfoMapper.updateById(studentInfo);
studentBaseInfoMapper.updateById(studentBaseInfo);
@ -48,6 +54,8 @@ public class StudentServiceImpl extends ServiceImpl<StudentInfoMapper, StudentIn
else {
// 学生学业信息入库
BeanUtils.copyProperties(studentInfoValidate, studentInfo);
// 预报名时间新增时设置为当前时间
studentInfo.setPreRegistrationTime(new Date());
studentInfoMapper.insert(studentInfo);
// 学生基本信息入库