@@ -43,19 +43,6 @@ public class ObjectUtils extends ObjectUtil {
return defaultValue;
}
- /**
- * 如果值不为空,则返回值
- *
- * @param obj 对象
- * @return 对象字段
- */
- public static <T> T notNull(T obj) {
- if (isNotNull(obj)) {
- return obj;
- }
- return null;
-
/**
* 如果值不为空,则返回值,否则返回默认值
*
@@ -71,7 +71,10 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
baseEntity.setUpdateTime(current);
// 获取当前登录用户的ID,并填充更新人信息
- baseEntity.setUpdateBy(ObjectUtils.notNull(LoginHelper.getUserId()));
+ Long userId = LoginHelper.getUserId();
+ if (ObjectUtil.isNotNull(userId)) {
+ baseEntity.setUpdateBy(userId);
+ }
} else {
this.strictUpdateFill(metaObject, "updateTime", Date.class, new Date());