From 554b419b35d84745900da6100cb639a2e280d965 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期五, 20 九月 2024 14:52:23 +0800
Subject: [PATCH] 添加家庭成员 手机修改为非必填

---
 java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 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 bdfac71..6cbdc48 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
@@ -281,11 +281,11 @@
     private static String PLATFORM_CODE = "0001";
 
     public static String nextId(String idLength) {
-        return nextId(idLength,true);
+        return nextId(idLength, true);
     }
 
     @SuppressWarnings("finally")
-    public static String nextId(String idLength,boolean hasRandom) {
+    public static String nextId(String idLength, boolean hasRandom) {
         LOCK.lock();
         try {
             if (lastCount == ONE_STEP) {
@@ -294,8 +294,8 @@
             count = lastCount++;
         } finally {
             LOCK.unlock();
-            String id = (hasRandom?getRandom():"") + String.format(idLength, count);
-            id = id.replace("-","");
+            String id = (hasRandom ? getRandom() : "") + String.format(idLength, count);
+            id = id.replace("-", "");
             return id;
         }
     }
@@ -346,7 +346,7 @@
      * @throws GenerateCodeException
      */
     public static String getGeneratorId(String prefix) throws GenerateCodeException {
-        return getGeneratorId(prefix,false);
+        return getGeneratorId(prefix, false);
     }
 
     /**
@@ -355,19 +355,20 @@
      * @return
      * @throws GenerateCodeException
      */
-    public static String getGeneratorId(String prefix,boolean longId) 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
-            if(longId) {
+            if (longId) {
                 return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_DEFAULT) + nextId("%06d");
-            }else {
+            } else {
                 return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d");
             }
         }
         //璋冪敤鏈嶅姟
         return getCode(prefix);
     }
+
     /**
      * pgId鐢熸垚
      *
@@ -376,7 +377,7 @@
      */
     public static String getDetailId(String prefix) throws GenerateCodeException {
         if (!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))) {
-            return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_O) + nextId("%06d",false);
+            return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_O) + nextId("%06d", false);
         }
         //璋冪敤鏈嶅姟
         return getCode(prefix);
@@ -1021,4 +1022,9 @@
         return uuid.toString().replaceAll("-", "");
     }
 
+    public static String getLink() {
+        String time = DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H);
+        time = time.substring(2);
+        return time + nextId("%04d",false);
+    }
 }

--
Gitblit v1.8.0