优化数据填充

This commit is contained in:
阿沐 2023-06-16 11:21:51 +08:00
parent 4203edeed5
commit a90d44679a

View File

@ -27,16 +27,20 @@ public class FieldMetaObjectHandler implements MetaObjectHandler {
UserDetail user = SecurityUser.getUser(); UserDetail user = SecurityUser.getUser();
Date date = new Date(); Date date = new Date();
// 用户字段填充
if (user != null) {
// 创建者 // 创建者
strictInsertFill(metaObject, CREATOR, Long.class, user.getId()); strictInsertFill(metaObject, CREATOR, Long.class, user.getId());
// 创建时间
strictInsertFill(metaObject, CREATE_TIME, Date.class, date);
// 更新者 // 更新者
strictInsertFill(metaObject, UPDATER, Long.class, user.getId()); strictInsertFill(metaObject, UPDATER, Long.class, user.getId());
// 更新时间
strictInsertFill(metaObject, UPDATE_TIME, Date.class, date);
// 创建者所属机构 // 创建者所属机构
strictInsertFill(metaObject, ORG_ID, Long.class, user.getOrgId()); strictInsertFill(metaObject, ORG_ID, Long.class, user.getOrgId());
}
// 创建时间
strictInsertFill(metaObject, CREATE_TIME, Date.class, date);
// 更新时间
strictInsertFill(metaObject, UPDATE_TIME, Date.class, date);
// 版本号 // 版本号
strictInsertFill(metaObject, VERSION, Integer.class, 0); strictInsertFill(metaObject, VERSION, Integer.class, 0);
// 删除标识 // 删除标识