dengjunjie
2024-12-05 46e98339480d853fc78a014c34d7ff9fcaf13890
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs
@@ -19,7 +19,7 @@
{
    public class DBSeed
    {
        private static string SeedDataFolder = "WIDESEAWCS_DB.DBSeed.Json/{0}.tsv";
        private static string SeedDataFolder = "WIDESEA_DB.DBSeed.Json/{0}.tsv";
        /// <summary>
        /// 寮傛娣诲姞绉嶅瓙鏁版嵁
@@ -27,7 +27,7 @@
        /// <param name="myContext"></param>
        /// <param name="WebRootPath"></param>
        /// <returns></returns>
        public static async Task SeedAsync(DBContext dbContext, string WebRootPath)
        public static void SeedAsync(DBContext dbContext, string WebRootPath)
        {
            try
            {
@@ -40,9 +40,7 @@
                Console.WriteLine("************ WIDESEA DataBase Set *****************");
                //Console.WriteLine($"Master DB ConId: {DBContext.ConnId}");
                Console.WriteLine($"Master DB Type: {DBContext.DbType}");
                //Console.WriteLine($"Master DB ConnectString: {DBContext.ConnectionString}");
                Console.WriteLine();
@@ -65,7 +63,7 @@
                Console.WriteLine("Create Tables...");
                var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
                var referencedAssemblies = System.IO.Directory.GetFiles(path, MainDb.AssemblyName).Select(Assembly.LoadFrom).ToArray();
                var referencedAssemblies = Directory.GetFiles(path, MainDb.AssemblyName).Select(Assembly.LoadFrom).ToArray();
                var modelTypes = referencedAssemblies
                    .SelectMany(a => a.DefinedTypes)
@@ -89,9 +87,9 @@
                        #region AddSeedData
                        if (seedData != "涓嶅瓨鍦ㄧ浉搴旂殑鐩綍")
                        {
                            List<Dictionary<string, object>> dicFile = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(seedData);
                            List<Dictionary<string, object>>? dicFile = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(seedData);
                            if (dicFile.Count > 0)
                            if (dicFile != null && dicFile.Count > 0)
                            {
                                List<Dictionary<string, object>> dic = new List<Dictionary<string, object>>();
@@ -105,7 +103,7 @@
                                    for (int i = 0; i < propertyInfos.Count; i++)
                                    {
                                        PropertyInfo propertyInfo = propertyInfos[i];
                                        SugarColumn sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>();
                                        SugarColumn? sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>();
                                        if (sugarColumn != null)
                                        {
                                            if (!sugarColumn.IsIgnore)
@@ -150,7 +148,7 @@
                            for (int i = 0; i < propertyInfos.Count; i++)
                            {
                                PropertyInfo propertyInfo = propertyInfos[i];
                                SugarColumn sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>();
                                SugarColumn? sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>();
                                if (sugarColumn != null)
                                {
                                    if (!sugarColumn.IsIgnore)