|
@@ -20,20 +20,28 @@ class CustomMetaObjectHandler : MetaObjectHandler() {
|
|
|
}
|
|
|
|
|
|
override fun insertFill(metaObject: MetaObject?) {
|
|
|
- val curUser = SSOUtil.getCurAccount()
|
|
|
- logger.debug("公共字段自动填充: insertFill $curUser")
|
|
|
- if (getFieldValByName("createBy", metaObject) == null) {
|
|
|
- setFieldValByName("createBy", curUser, metaObject)
|
|
|
- }
|
|
|
- if (getFieldValByName("createTime", metaObject) == null) {
|
|
|
- setFieldValByName("createTime", Date(), metaObject)
|
|
|
+ try {
|
|
|
+ val curUser = SSOUtil.getCurAccount()
|
|
|
+ logger.trace("公共字段自动填充: insertFill $curUser")
|
|
|
+ if (getFieldValByName("createBy", metaObject) == null) {
|
|
|
+ setFieldValByName("createBy", curUser, metaObject)
|
|
|
+ }
|
|
|
+ if (getFieldValByName("createTime", metaObject) == null) {
|
|
|
+ setFieldValByName("createTime", Date(), metaObject)
|
|
|
+ }
|
|
|
+ } catch (e: Throwable) {
|
|
|
+ logger.warn("insertFill error, cause: ", e)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
override fun updateFill(metaObject: MetaObject?) {
|
|
|
- val curUser = SSOUtil.getCurAccount()
|
|
|
- logger.debug("公共字段自动填充: updateFill $curUser")
|
|
|
- setFieldValByName("updateBy", curUser, metaObject)
|
|
|
- setFieldValByName("updateTime", Date(), metaObject)
|
|
|
+ try {
|
|
|
+ val curUser = SSOUtil.getCurAccount()
|
|
|
+ logger.trace("公共字段自动填充: updateFill $curUser")
|
|
|
+ setFieldValByName("updateBy", curUser, metaObject)
|
|
|
+ setFieldValByName("updateTime", Date(), metaObject)
|
|
|
+ } catch (e: Throwable) {
|
|
|
+ logger.warn("updateFill error, cause: ", e)
|
|
|
+ }
|
|
|
}
|
|
|
}
|