update 优化 删除无意义的方法

dev
疯狂的狮子Li 1 year ago
parent a6bc63761d
commit b3cb99118a

@ -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;
}
/**
*
*

@ -70,7 +70,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());
}

Loading…
Cancel
Save