From 42408657bee79b0da3b69ca5ab062c50e4da8bc6 Mon Sep 17 00:00:00 2001 From: jlzhou <12020042@qq.com> Date: Wed, 13 Nov 2024 15:17:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89mybaits-plus=E7=9A=84=E4=B8=BB=E9=94=AE=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=99=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/framework/config/MybatisPlusConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java index ef9d683..be4b377 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java @@ -100,11 +100,17 @@ public class MybatisPlusConfig { @Override public Number nextId(Object entity) { + if(ObjUtil.isNull(entity)){ + return IdUtils.nextDateIdLong(17); + } return IdUtils.nextDateIdLong(entity.getClass().getSimpleName(), 17); } @Override public String nextUUID(Object entity) { + if(ObjUtil.isNull(entity)){ + return IdUtils.nextDateId(17); + } return IdUtils.nextDateId(entity.getClass().getSimpleName(), 17); } };