update 优化 自动填充更新人逻辑
This commit is contained in:
parent
3a4990e3d4
commit
bec97982a6
@ -54,13 +54,12 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
|||||||
Date current = new Date();
|
Date current = new Date();
|
||||||
// 更新时间填充(不管为不为空)
|
// 更新时间填充(不管为不为空)
|
||||||
baseEntity.setUpdateTime(current);
|
baseEntity.setUpdateTime(current);
|
||||||
if (ObjectUtil.isNull(baseEntity.getUpdateBy())) {
|
// 当前已登录 更新人填充(不管为不为空)
|
||||||
LoginUser loginUser = getLoginUser();
|
Long userId = LoginHelper.getUserId();
|
||||||
// 当前已登录 更新人填充(不管为不为空)
|
if (ObjectUtil.isNotNull(userId)) {
|
||||||
if (ObjectUtil.isNotNull(loginUser)) {
|
baseEntity.setUpdateBy(userId);
|
||||||
baseEntity.setUpdateBy(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);
|
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user