schangxiang@126.com
2025-05-07 06c2653afafc14fac832ba7ba39624b040d39ec5
//去重操作
columnList = columnList.GroupBy(p => p.ColumnName).Select(g => g.First()).ToList();
已修改2个文件
9 ■■■■■ 文件已修改
Weben_CMS专用代码生成器/Code/App.config 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/DataBaseFactory/Default/MySqlDataBaseServiceHandle.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/App.config
@@ -3,7 +3,8 @@
  <connectionStrings>
    <add name="本地_MySql_CMS" connectionString="Server=localhost;Database=07a6b2f4bbb04e8bb23a9f17a4a769c2_project;Uid=root;Pwd=123abc.com;" />
    <add name="ZS_本地WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" />
    <add name="LA22012_武汉牧野_生产库_伟本环境" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=123abc.com" />
    <add name="Shao_本地WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" />
    <!--  <add name="LA22012_武汉牧野_生产库_伟本环境" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=123abc.com" />
    <add name="LA22012_武汉牧野_生产库_26测试环境" connectionString="Data Source=172.27.96.26;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=MJC!2022@wms" />
    <add name="LA22012_武汉牧野_备件库_伟本环境" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=123abc.com" />
    <add name="LA22012_武汉牧野_备件库_26测试环境" connectionString="Data Source=172.27.96.26;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=MJC!2022@wms" />
@@ -12,7 +13,7 @@
    <add name="LA18032_AoSinWms_云" connectionString="Data Source=120.53.244.200;Initial Catalog=LA18032_AoSinWms;Persist Security Info=True;User ID=sa;Password=123abc.com" />
    <add name="GSiemens_LES" connectionString="Data Source=localhost;Initial Catalog=GSiemens_LES;Persist Security Info=True;User ID=sa;Password=123abc.com" />
    <add name="GSiemens_WIP" connectionString="Data Source=.;Initial Catalog=GSiemens_WIP;Persist Security Info=True;User ID=sa;Password=123abc.com" />
    <add name="LocalhostConn" connectionString="Data Source=shaocx;Initial Catalog=SOADB;User ID=sa;Password=1111" />
    <add name="LocalhostConn" connectionString="Data Source=shaocx;Initial Catalog=SOADB;User ID=sa;Password=1111" /> -->
  </connectionStrings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup>
  <runtime>
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/DataBaseFactory/Default/MySqlDataBaseServiceHandle.cs
@@ -15,7 +15,7 @@
            //string strSql = $"SELECT COLUMN_NAME as ColumnName, COLUMN_TYPE as DataType, IS_NULLABLE as IsNullable, CHARACTER_MAXIMUM_LENGTH as DataLength,COLUMN_COMMENT as Description " +
            //                       $"FROM INFORMATION_SCHEMA.COLUMNS " +
            //                       $"WHERE  TABLE_NAME = '{tableName}'";
            string strSql = $"SELECT DISTINCT c.COLUMN_NAME as ColumnName, c.DATA_TYPE as DataType, c.IS_NULLABLE as IsNullable, c.CHARACTER_MAXIMUM_LENGTH as DataLength, c.COLUMN_COMMENT as Description,c.NUMERIC_SCALE as MyPrecision, " +
            string strSql = $"SELECT  c.COLUMN_NAME as ColumnName, c.DATA_TYPE as DataType, c.IS_NULLABLE as IsNullable, c.CHARACTER_MAXIMUM_LENGTH as DataLength, c.COLUMN_COMMENT as Description,c.NUMERIC_SCALE as MyPrecision, " +
                $"CASE WHEN kcu.COLUMN_NAME IS NOT NULL THEN 'true' ELSE 'false' END AS IsPrimaryKey " +
                $"FROM INFORMATION_SCHEMA.COLUMNS c " +
                $"LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu " +
@@ -32,6 +32,8 @@
            {
                DataSet ds = MySqlHelper.Query(connStr, strSql);
                columnList = DataTableToList(ds.Tables[0]);
                //去重操作
                columnList = columnList.GroupBy(p => p.ColumnName).Select(g => g.First()).ToList();
            }
            catch
            {