From 9e89e605d5429babb4b33df2e47ea86dff9d2ba7 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 20 十一月 2025 11:55:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/Config/ConfigParse.cs |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/Main/Config/ConfigParse.cs b/Main/Config/ConfigParse.cs
index c1461f7..da09db2 100644
--- a/Main/Config/ConfigParse.cs
+++ b/Main/Config/ConfigParse.cs
@@ -320,13 +320,35 @@
         return result;
     }
 
+    //json鏍煎紡锛� {"1":{"1":1,"2":2},"2":{"3":3,"4":4}}
+    public static Dictionary<int, Dictionary<int, int>> ParseDictInDict(string jsonStr)
+    {
+        if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr))
+        {
+            return new Dictionary<int, Dictionary<int, int>>();
+        }
+        var dict = JsonMapper.ToObject<Dictionary<string, Dictionary<string, int>>>(jsonStr);
+        Dictionary<int, Dictionary<int, int>> result = new Dictionary<int, Dictionary<int, int>>();
+
+        foreach (var item in dict)
+        {
+            Dictionary<int, int> subDict = new Dictionary<int, int>();
+            foreach (var subItem in item.Value)
+            {
+                subDict[int.Parse(subItem.Key)] = subItem.Value;
+            }
+            result[int.Parse(item.Key)] = subDict;
+        }
+        
+        return result;
+    }
 
     //涓囧垎鐜囪浆涓烘瘡涓猧d瀵瑰簲鐨勬鐜� [[涓囧垎姒傜巼锛宨d1],[涓囧垎姒傜巼锛宨d2]]
     public static Dictionary<int, int> GetRateDict(int[][] rateArray)
     {
         Dictionary<int, int> dic = new Dictionary<int, int>();
         //姒傜巼涓� 鍑忓幓涓婁竴涓鐜囩殑鍊煎嵆涓哄綋鍓岻D姒傜巼
-        for (int i = 0;i< rateArray.Length; i++)
+        for (int i = 0; i < rateArray.Length; i++)
         {
             if (i > 0)
             {

--
Gitblit v1.8.0