dsx 2 lat temu
rodzic
commit
77c49bf597

+ 12 - 0
4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/CommonOperStatus.java

@@ -22,4 +22,16 @@ public enum CommonOperStatus {
         return message;
     }
 
+    public static CommonOperStatus get(Integer code){
+        CommonOperStatus[] values = CommonOperStatus.values();
+        Integer enumValue = null;
+        for(CommonOperStatus eachValue : values){
+            enumValue = eachValue.code();
+            if(enumValue.equals(code)){
+                return eachValue;
+            }
+        }
+        return null;
+    }
+
 }

+ 24 - 0
4dkankan-utils-model/src/main/java/com/fdkankan/model/utils/SceneUtil.java

@@ -9,7 +9,9 @@ import com.fdkankan.model.constants.ConstantFilePath;
 
 import java.io.File;
 import java.nio.charset.Charset;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -71,5 +73,27 @@ public class SceneUtil {
         return homePath;
     }
 
+    public static Map<String, String> getPropertyFromDataSource(String dataSource){
+        if(StrUtil.isEmpty(dataSource)){
+            return null;
+        }
+        String homePath = getHomePath(dataSource);
+        homePath = homePath.substring(0, homePath.lastIndexOf("/"));
+        String[] arr = homePath.split("/");
+        Map<String, String> result = new HashMap<>();
+        result.put("homePath", homePath);
+        result.put("snCode", arr[1]);
+        result.put("fileId", arr[2]);
+        result.put("uuid", arr[3]);
+        return result;
+    }
+
+    public static void main(String[] args) {
+        String str = "27";
+        int  n = 8;
+        System.out.println("10进制=" + Integer.parseInt(str, n));
+        System.out.println(Integer.toHexString(Integer.parseInt(str, n)));
+    }
+
 
 }