From 3d8ec5c23ef49d0908195c8b5b892920a46aaa8c Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 30 五月 2023 11:42:48 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java b/java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
index 6eda4e4..d953bc7 100644
--- a/java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
+++ b/java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
@@ -346,10 +346,24 @@
      * @throws GenerateCodeException
      */
     public static String getGeneratorId(String prefix) throws GenerateCodeException {
+        return getGeneratorId(prefix,false);
+    }
+
+    /**
+     * pgId鐢熸垚
+     *
+     * @return
+     * @throws GenerateCodeException
+     */
+    public static String getGeneratorId(String prefix,boolean longId) throws GenerateCodeException {
         if (!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))) {
             //2+14+4+6
             //7920230518235714886
-            return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_DEFAULT) + nextId("%06d");
+            if(longId) {
+                return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_DEFAULT) + nextId("%06d");
+            }else {
+                return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d");
+            }
         }
         //璋冪敤鏈嶅姟
         return getCode(prefix);

--
Gitblit v1.8.0