From 9423f2936340d82b046ec615381c1c5e03698557 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期五, 27 九月 2024 17:56:53 +0800
Subject: [PATCH] 1、主要完成对获取UI上下文的定义接口的优化,优化的方向为对多次获取业务类型对象进行转换而导致耗时较久的问题继续修改,还有对多次获取属性对象进行转换对象导致耗时过长问题进行修改。 2、对树的数据查询接口的优化,对多次获取属性对象进行转换对象导致耗时过长问题进行修改。

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/Func.java |   64 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/Func.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/Func.java
index 86007ae..14206fd 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/Func.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/Func.java
@@ -40,6 +40,60 @@
 public class Func {
 
     /**
+     * 閫氬父鐢ㄤ簬灏嗕富閿畂id杞崲鎴�8浣嶅敮涓�hash鐮佸��
+     * @return
+     */
+    public static String oidEnHash(String oid){
+        UUID originalUUID = UUID.fromString(oid);
+        // 浣跨敤Base64缂栫爜灏嗗師濮婾UID杞崲涓鸿緝鐭殑瀛楃涓�
+        String base64String = Base64.getUrlEncoder().withoutPadding().encodeToString(new byte[] {
+                (byte)(originalUUID.getMostSignificantBits()>>>56),
+                (byte)(originalUUID.getMostSignificantBits()>>>48),
+                (byte)(originalUUID.getMostSignificantBits()>>>40),
+                (byte)(originalUUID.getMostSignificantBits()>>>32),
+                (byte)(originalUUID.getMostSignificantBits()>>>24),
+                (byte)(originalUUID.getMostSignificantBits()>>>16),
+                (byte)(originalUUID.getMostSignificantBits()>>>8),
+                (byte)(originalUUID.getMostSignificantBits()),
+                (byte)(originalUUID.getLeastSignificantBits()>>>56),
+                (byte)(originalUUID.getLeastSignificantBits()>>>48),
+                (byte)(originalUUID.getLeastSignificantBits()>>>40),
+                (byte)(originalUUID.getLeastSignificantBits()>>>32),
+                (byte)(originalUUID.getLeastSignificantBits()>>>24),
+                (byte)(originalUUID.getLeastSignificantBits()>>>16),
+                (byte)(originalUUID.getLeastSignificantBits()>>>8),
+                (byte)(originalUUID.getLeastSignificantBits())});
+        return base64String;
+    }
+
+    /**
+     * 閫氬父鐢ㄤ簬灏嗕富閿畂id杞崲鎴愮殑8浣嶅敮涓�hash鐮侊紝鍙嶈浆涓簅id
+     * @param base64String
+     * @return
+     */
+    public static String oidDeHash(String base64String){
+        // 鍙嶆帹鍥炲師濮嬬殑UUID瀛楃涓�
+        byte[] bytes = Base64.getUrlDecoder().decode(base64String);
+        UUID reconstructedUUID = new UUID(((long)(bytes[0] & 0xff) << 56)
+                | ((long)(bytes[1] & 0xff) << 48)
+                | ((long)(bytes[2] & 0xff) << 40)
+                | ((long)(bytes[3] & 0xff) << 32)
+                | ((long)(bytes[4] & 0xff) << 24)
+                | ((long)(bytes[5] & 0xff) << 16)
+                | ((long)(bytes[6] & 0xff) << 8)
+                | (bytes[7] & 0xff),
+                ((long)(bytes[8] & 0xff) << 56)
+                        | ((long)(bytes[9] & 0xff) << 48)
+                        | ((long)(bytes[10] & 0xff) << 40)
+                        | ((long)(bytes[11] & 0xff) << 32)
+                        | ((long)(bytes[12] & 0xff) << 24)
+                        | ((long)(bytes[13] & 0xff) << 16)
+                        | ((long)(bytes[14] & 0xff) << 8)
+                        | (bytes[15] & 0xff));
+        return reconstructedUUID.toString().toUpperCase(Locale.ROOT);
+    }
+
+    /**
      * 鏂█锛屽繀椤讳笉鑳戒负 null
      * <blockquote><pre>
      * public Foo(Bar bar) {
@@ -1178,6 +1232,16 @@
     }
 
     /**
+     * AES 瑙e瘑
+     * @param encryptedData
+     * @param secretKey
+     * @return
+     */
+    public static String decryptAes(String encryptedData, String secretKey) throws Exception {
+        return DigestUtil.decryptAes(encryptedData, secretKey);
+    }
+
+    /**
      * hmacMd5 Hex
      *
      * @param bytes Data to digest

--
Gitblit v1.9.3