|
@@ -20,24 +20,22 @@ class CustomMetaObjectHandler : MetaObjectHandler() {
|
|
|
}
|
|
|
|
|
|
override fun insertFill(metaObject: MetaObject?) {
|
|
|
- val temp = DynamicMultipleDataSource.getDataSource()
|
|
|
- logger.debug("公共字段自动填充: insertFill ${SSOUtil.getCurUser()?.account}")
|
|
|
+ val curUser = SSOUtil.getCurUser()
|
|
|
+ logger.debug("公共字段自动填充: insertFill ${curUser?.account}")
|
|
|
if (getFieldValByName("createBy", metaObject) == null) {
|
|
|
- setFieldValByName("createBy", SSOUtil.getCurUser()?.account, metaObject)
|
|
|
+ setFieldValByName("createBy", curUser?.account, metaObject)
|
|
|
}
|
|
|
if (getFieldValByName("createTime", metaObject) == null) {
|
|
|
setFieldValByName("createTime", Date(), metaObject)
|
|
|
}
|
|
|
- DynamicMultipleDataSource.setDataSource(temp)
|
|
|
}
|
|
|
|
|
|
override fun updateFill(metaObject: MetaObject?) {
|
|
|
- val temp = DynamicMultipleDataSource.getDataSource()
|
|
|
- logger.debug("公共字段自动填充: updateFill ${SSOUtil.getCurUser()?.account}")
|
|
|
+ val curUser = SSOUtil.getCurUser()
|
|
|
+ logger.debug("公共字段自动填充: updateFill ${curUser?.account}")
|
|
|
if (getFieldValByName("updateBy", metaObject) == null) {
|
|
|
- setFieldValByName("updateBy", SSOUtil.getCurUser()?.account, metaObject)
|
|
|
+ setFieldValByName("updateBy", curUser?.account, metaObject)
|
|
|
}
|
|
|
setFieldValByName("updateTime", Date(), metaObject)
|
|
|
- DynamicMultipleDataSource.setDataSource(temp)
|
|
|
}
|
|
|
}
|