|
|
|
@ -27,8 +27,10 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
|
|
|
|
|
this.setFieldValByName("createTime", new Date(), metaObject);
|
|
|
|
|
}
|
|
|
|
|
if (metaObject.hasGetter("createBy")) {
|
|
|
|
|
if (metaObject.getValue("createBy") == null) {
|
|
|
|
|
this.setFieldValByName("createBy", getLoginUsername(), metaObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);
|
|
|
|
|
}
|
|
|
|
@ -39,8 +41,10 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
|
|
|
|
|
public void updateFill(MetaObject metaObject) {
|
|
|
|
|
try {
|
|
|
|
|
if (metaObject.hasGetter("updateBy")) {
|
|
|
|
|
if (metaObject.getValue("updateBy") == null) {
|
|
|
|
|
this.setFieldValByName("updateBy", getLoginUsername(), metaObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (metaObject.hasGetter("updateTime")) {
|
|
|
|
|
this.setFieldValByName("updateTime", new Date(), metaObject);
|
|
|
|
|
}
|
|
|
|
|