buhuazhen
4 天以前 b36dfcb807af748dabdbc76a134b0667196563f6
src/main/java/com/ruoyi/common/config/MybatisHandler.java
@@ -14,9 +14,11 @@
    public void insertFill(MetaObject metaObject) {
        Integer userId = null;
        Long tenantId = null;
        String userName = null;
        try {
            userId = SecurityUtils.getUserId().intValue();
            tenantId = SecurityUtils.getLoginUser().getTenantId();
            userName = SecurityUtils.getUsername();
        } catch (Exception ignored) {
        }
        this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
@@ -25,6 +27,9 @@
        this.strictInsertFill(metaObject, "updateUser", Integer.class, userId);
        this.strictInsertFill(metaObject, "createUser", Long.class, userId == null ? 0 : userId.longValue());
        this.strictInsertFill(metaObject, "updateUser", Long.class, userId == null ? 0 : userId.longValue());
        this.strictInsertFill(metaObject, "createUserName", String.class, userName);
        this.strictInsertFill(metaObject, "updateUserName", String.class, userName);
        this.strictInsertFill(metaObject, "tenantId", Long.class, tenantId);
    }