|
|
@@ -36,6 +36,12 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
|
|
|
@Override
|
|
|
public void insertFill(MetaObject metaObject) {
|
|
|
try {
|
|
|
+ LoginUser loginUser =null;
|
|
|
+ try {
|
|
|
+ loginUser= SecurityUtil.getLoginUser();
|
|
|
+ }catch (Exception __){
|
|
|
+
|
|
|
+ }
|
|
|
if (metaObject.hasGetter(CREATE_TIME) && metaObject.getValue(CREATE_TIME) == null) {
|
|
|
this.strictInsertFill(metaObject, CREATE_TIME, Date.class, new Date());
|
|
|
}
|
|
|
@@ -43,14 +49,13 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
|
|
|
this.strictInsertFill(metaObject, IS_DELETE, Integer.class,0);
|
|
|
}
|
|
|
if (metaObject.hasGetter(CREATE_BY) && metaObject.getValue(CREATE_BY) == null) {
|
|
|
- LoginUser loginUser = SecurityUtil.getLoginUser();
|
|
|
+
|
|
|
this.strictInsertFill(metaObject, CREATE_BY, String.class, Objects.isNull(loginUser) ? "1" : loginUser.getId().toString());
|
|
|
}
|
|
|
if (metaObject.hasGetter(UPDATE_TIME) && metaObject.getValue(UPDATE_TIME) == null) {
|
|
|
this.strictUpdateFill(metaObject, UPDATE_TIME, Date.class, new Date());
|
|
|
}
|
|
|
if (metaObject.hasGetter(UPDATE_BY) && metaObject.getValue(UPDATE_BY) == null) {
|
|
|
- LoginUser loginUser = SecurityUtil.getLoginUser();
|
|
|
this.strictUpdateFill(metaObject, UPDATE_BY, String.class, Objects.isNull(loginUser) ? "1" : loginUser.getId().toString());
|
|
|
}
|
|
|
if (metaObject.hasGetter(TENANT_ID) && metaObject.getValue(TENANT_ID) == null) {
|