11 小时以前 a962579b636b055bb70ae2233787d42483eb4b3b
src/main/java/com/ruoyi/common/config/MybatisHandler.java
@@ -15,10 +15,12 @@
        Integer userId = null;
        Long tenantId = null;
        String userName = null;
        Long deptId = null;
        try {
            userId = SecurityUtils.getUserId().intValue();
            tenantId = SecurityUtils.getLoginUser().getTenantId();
            userName = SecurityUtils.getUsername();
            deptId = SecurityUtils.getDeptId()[0];
        } catch (Exception ignored) {
        }
        this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
@@ -29,6 +31,7 @@
        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, "deptId", Long.class, deptId);
        this.strictInsertFill(metaObject, "tenantId", Long.class, tenantId);
    }