Commit 169d19fa authored by Ryan Loong's avatar Ryan Loong

update 优化学生创建逻辑

parent 8169463b
......@@ -73,9 +73,27 @@ public class StudentInfoService {
return "Fail 学号重复! 请重新输入学号";
}
LocalDateTime now = LocalDateTime.now();
studentInfo.setAddTime(now);
studentInfo.setUpdateTime(now);
studentInfoMapper.insertSelective(studentInfo);
StudentInfo record = new StudentInfo();
BeanUtils.copyProperties(studentInfo, record,
StudentInfo.Column.id.getJavaProperty(),
StudentInfo.Column.callTimes.getJavaProperty(),
StudentInfo.Column.addTime.getJavaProperty(),
StudentInfo.Column.updateTime.getJavaProperty(),
StudentInfo.Column.deleted.getJavaProperty(),
"incrementColumnsInfoMap"
);
record.setCallTimes(0);
record.setAddTime(now);
record.setUpdateTime(now);
record.setDeleted(StudentInfo.NOT_DELETED);
if (StringUtils.isBlank(record.getHead()) || URL_DEFAULT_HEAD.equalsIgnoreCase(record.getHead())) {
record.setHead(STRING_DEFAULT_HEAD);
}
studentInfoMapper.insert(record);
return "OK 添加成功";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment