处理预报名时间字段
This commit is contained in:
parent
746cb5dca4
commit
655cff6256
|
|
@ -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);
|
||||
|
||||
// 学生基本信息入库
|
||||
|
|
|
|||
Loading…
Reference in New Issue