소스 검색

部门数据处理

lin.liu 3 주 전
부모
커밋
fd4e086064

+ 4 - 0
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/core/domain/entity/SysDept.java

@@ -74,6 +74,10 @@ public class SysDept extends TreeEntity<SysDept> {
      * h4a guid
      */
     private String guid;
+    /**
+     * h4a父级guid
+     */
+    private String parentGuid;
 
     /**
      * h4a guid

+ 12 - 0
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/utils/StringUtil.java

@@ -835,4 +835,16 @@ public final class StringUtil {
         }
         return str.toString();
     }
+
+    public static Long guidToId(String guid) {
+        String str = StringUtil.toHexString(guid).toUpperCase()
+                .replaceAll("A", "10")
+                .replaceAll("B", "11")
+                .replaceAll("C", "12")
+                .replaceAll("D", "13")
+                .replaceAll("E", "14")
+                .replaceAll("F", "15");
+        int idx = str.length() - 16;
+        return Long.parseLong(str.substring(idx,  idx + 15) + StringUtil.splitList(str, 1).stream().mapToLong(Long::parseLong).sum());
+    }
 }