222
schangxiang@126.com
2025-05-04 7ecca2a5e7a9c9ae811b68dc98e05c689b18aca6
222
已添加2个文件
已修改8个文件
322 ■■■■ 文件已修改
Weben_CMS专用代码生成器/Code/Generate/Entity/AddModel_Generate.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/Generate/Entity/CreateOrUpdateDtoBase_Generate.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/Generate/Entity/Dto_Generate.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/GenerateCode_WeiBen_CMS.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/MainForm.Designer.cs 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/MainForm.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/Model/GenerateCodeParam.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/Templete/Entity/Dto模板.txt 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/Utility/StructStrHelper.cs 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/版本说明.txt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Entity/AddModel_Generate.cs
@@ -25,7 +25,7 @@
            List<ColumnModel> newColumnNameList = ListHelper.RemoveIdCreatorModifier(columnNameList);
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForAddModel(newColumnNameList[i]);
                // attrString += StructStrHelper.GenerateAttributeForAddModel(newColumnNameList[i]);
            }
            str = str.Replace("$AddAttributes$", attrString);
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Entity/CreateOrUpdateDtoBase_Generate.cs
@@ -25,7 +25,7 @@
            List<ColumnModel> newColumnNameList = ListHelper.RemoveIdCreatorModifier(param.ColumnNameList);
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForAddModel(newColumnNameList[i]);
                attrString += StructStrHelper.GenerateAttributeForAddModel(newColumnNameList[i], param);
            }
            str = str.Replace("$AddAttributes$", attrString);
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Entity/Dto_Generate.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@

using GenerateCode_WeiBen_WMS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GenerateCode_GEBrilliantFactory
{
    /// <summary>
    /// ç”ŸæˆæŸ¥è¯¢å®žä½“ç±»
    /// </summary>
    public class Dto_Generate : BaseGenerate
    {
        public static string CreateText(GenerateCodeParam param)
        {
            var str = TextHelper.ReadText(@"Templete\Entity\Dto模板.txt");
            CommonReplace(ref str);
            CommonHelper.CommonReplaceStr(param, ref str);
            string attrString = "";
            List<ColumnModel> newColumnNameList = ListHelper.OnlyRemoveId(param.ColumnNameList);
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForDto(newColumnNameList[i], param);
            }
            str = str.Replace("$AddAttributesForDto$", attrString);
            return str;
        }
    }
}
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/GenerateCode_WeiBen_CMS.csproj
@@ -109,6 +109,7 @@
    <Compile Include="Generate\BaseGenerate.cs" />
    <Compile Include="Generate\Controller\Controller_Generate.cs" />
    <Compile Include="Generate\Entity\AddModel_Generate.cs" />
    <Compile Include="Generate\Entity\Dto_Generate.cs" />
    <Compile Include="Generate\Entity\UpdateDto_Generate.cs" />
    <Compile Include="Generate\Entity\CreateOrUpdateDtoBase_Generate.cs" />
    <Compile Include="Generate\Entity\CreateDto_Generate.cs" />
@@ -194,6 +195,9 @@
    <Content Include="Templete\Entity\AddModel模板.txt">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Templete\Entity\Dto模板.txt">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Templete\Entity\UpdateDto模板.txt">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/MainForm.Designer.cs
@@ -74,6 +74,9 @@
            this.label12 = new System.Windows.Forms.Label();
            this.tb_templeteFileDownName = new System.Windows.Forms.TextBox();
            this.label14 = new System.Windows.Forms.Label();
            this.tb_EnumList = new System.Windows.Forms.TextBox();
            this.label18 = new System.Windows.Forms.Label();
            this.label19 = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
@@ -82,7 +85,7 @@
            // btnPath
            // 
            this.btnPath.Location = new System.Drawing.Point(567, 712);
            this.btnPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.btnPath.Margin = new System.Windows.Forms.Padding(4);
            this.btnPath.Name = "btnPath";
            this.btnPath.Size = new System.Drawing.Size(129, 29);
            this.btnPath.TabIndex = 1;
@@ -103,7 +106,7 @@
            // tbPath
            // 
            this.tbPath.Location = new System.Drawing.Point(141, 708);
            this.tbPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tbPath.Margin = new System.Windows.Forms.Padding(4);
            this.tbPath.Name = "tbPath";
            this.tbPath.ReadOnly = true;
            this.tbPath.Size = new System.Drawing.Size(336, 25);
@@ -112,7 +115,7 @@
            // btnExit
            // 
            this.btnExit.Location = new System.Drawing.Point(865, 750);
            this.btnExit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.btnExit.Margin = new System.Windows.Forms.Padding(4);
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(228, 84);
            this.btnExit.TabIndex = 8;
@@ -123,7 +126,7 @@
            // btn_CreateFile
            // 
            this.btn_CreateFile.Location = new System.Drawing.Point(141, 750);
            this.btn_CreateFile.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.btn_CreateFile.Margin = new System.Windows.Forms.Padding(4);
            this.btn_CreateFile.Name = "btn_CreateFile";
            this.btn_CreateFile.Size = new System.Drawing.Size(209, 84);
            this.btn_CreateFile.TabIndex = 14;
@@ -134,7 +137,7 @@
            // tb_TableName
            // 
            this.tb_TableName.Location = new System.Drawing.Point(123, 86);
            this.tb_TableName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_TableName.Margin = new System.Windows.Forms.Padding(4);
            this.tb_TableName.Name = "tb_TableName";
            this.tb_TableName.Size = new System.Drawing.Size(243, 25);
            this.tb_TableName.TabIndex = 15;
@@ -143,7 +146,7 @@
            // tb_FileName
            // 
            this.tb_FileName.Location = new System.Drawing.Point(295, 190);
            this.tb_FileName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_FileName.Margin = new System.Windows.Forms.Padding(4);
            this.tb_FileName.Name = "tb_FileName";
            this.tb_FileName.Size = new System.Drawing.Size(264, 25);
            this.tb_FileName.TabIndex = 17;
@@ -161,7 +164,7 @@
            // tb_WCF_NameSpacePath
            // 
            this.tb_WCF_NameSpacePath.Location = new System.Drawing.Point(751, 309);
            this.tb_WCF_NameSpacePath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_WCF_NameSpacePath.Margin = new System.Windows.Forms.Padding(4);
            this.tb_WCF_NameSpacePath.Name = "tb_WCF_NameSpacePath";
            this.tb_WCF_NameSpacePath.Size = new System.Drawing.Size(261, 25);
            this.tb_WCF_NameSpacePath.TabIndex = 19;
@@ -179,7 +182,7 @@
            // tb_ChinaComment
            // 
            this.tb_ChinaComment.Location = new System.Drawing.Point(295, 292);
            this.tb_ChinaComment.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_ChinaComment.Margin = new System.Windows.Forms.Padding(4);
            this.tb_ChinaComment.Name = "tb_ChinaComment";
            this.tb_ChinaComment.Size = new System.Drawing.Size(261, 25);
            this.tb_ChinaComment.TabIndex = 23;
@@ -197,7 +200,7 @@
            // tb_CreatePerson
            // 
            this.tb_CreatePerson.Location = new System.Drawing.Point(295, 349);
            this.tb_CreatePerson.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_CreatePerson.Margin = new System.Windows.Forms.Padding(4);
            this.tb_CreatePerson.Name = "tb_CreatePerson";
            this.tb_CreatePerson.Size = new System.Drawing.Size(264, 25);
            this.tb_CreatePerson.TabIndex = 25;
@@ -215,7 +218,7 @@
            // tb_Primary
            // 
            this.tb_Primary.Location = new System.Drawing.Point(451, 86);
            this.tb_Primary.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_Primary.Margin = new System.Windows.Forms.Padding(4);
            this.tb_Primary.Name = "tb_Primary";
            this.tb_Primary.Size = new System.Drawing.Size(192, 25);
            this.tb_Primary.TabIndex = 27;
@@ -233,7 +236,7 @@
            // tb_EntityProName
            // 
            this.tb_EntityProName.Location = new System.Drawing.Point(747, 176);
            this.tb_EntityProName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_EntityProName.Margin = new System.Windows.Forms.Padding(4);
            this.tb_EntityProName.Name = "tb_EntityProName";
            this.tb_EntityProName.Size = new System.Drawing.Size(243, 25);
            this.tb_EntityProName.TabIndex = 31;
@@ -252,7 +255,7 @@
            // tb_EntityName
            // 
            this.tb_EntityName.Location = new System.Drawing.Point(123, 135);
            this.tb_EntityName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_EntityName.Margin = new System.Windows.Forms.Padding(4);
            this.tb_EntityName.Name = "tb_EntityName";
            this.tb_EntityName.Size = new System.Drawing.Size(243, 25);
            this.tb_EntityName.TabIndex = 29;
@@ -280,7 +283,7 @@
            // tb_OrderBy
            // 
            this.tb_OrderBy.Location = new System.Drawing.Point(671, 259);
            this.tb_OrderBy.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_OrderBy.Margin = new System.Windows.Forms.Padding(4);
            this.tb_OrderBy.Name = "tb_OrderBy";
            this.tb_OrderBy.Size = new System.Drawing.Size(192, 25);
            this.tb_OrderBy.TabIndex = 35;
@@ -298,7 +301,7 @@
            // tb_PrimaryDesc
            // 
            this.tb_PrimaryDesc.Location = new System.Drawing.Point(759, 86);
            this.tb_PrimaryDesc.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_PrimaryDesc.Margin = new System.Windows.Forms.Padding(4);
            this.tb_PrimaryDesc.Name = "tb_PrimaryDesc";
            this.tb_PrimaryDesc.Size = new System.Drawing.Size(192, 25);
            this.tb_PrimaryDesc.TabIndex = 38;
@@ -316,7 +319,7 @@
            // tb_Modulelogo
            // 
            this.tb_Modulelogo.Location = new System.Drawing.Point(295, 252);
            this.tb_Modulelogo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_Modulelogo.Margin = new System.Windows.Forms.Padding(4);
            this.tb_Modulelogo.Name = "tb_Modulelogo";
            this.tb_Modulelogo.Size = new System.Drawing.Size(264, 25);
            this.tb_Modulelogo.TabIndex = 41;
@@ -334,7 +337,7 @@
            // btn_InsertSql
            // 
            this.btn_InsertSql.Location = new System.Drawing.Point(513, 750);
            this.btn_InsertSql.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.btn_InsertSql.Margin = new System.Windows.Forms.Padding(4);
            this.btn_InsertSql.Name = "btn_InsertSql";
            this.btn_InsertSql.Size = new System.Drawing.Size(209, 84);
            this.btn_InsertSql.TabIndex = 42;
@@ -346,7 +349,7 @@
            // tb_RoutePrefix
            // 
            this.tb_RoutePrefix.Location = new System.Drawing.Point(717, 345);
            this.tb_RoutePrefix.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_RoutePrefix.Margin = new System.Windows.Forms.Padding(4);
            this.tb_RoutePrefix.Name = "tb_RoutePrefix";
            this.tb_RoutePrefix.Size = new System.Drawing.Size(192, 25);
            this.tb_RoutePrefix.TabIndex = 44;
@@ -370,9 +373,9 @@
            this.groupBox1.Controls.Add(this.lbl_DataSource);
            this.groupBox1.Controls.Add(this.cmb_DataSource);
            this.groupBox1.Location = new System.Drawing.Point(68, 15);
            this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
            this.groupBox1.Size = new System.Drawing.Size(1092, 90);
            this.groupBox1.TabIndex = 45;
            this.groupBox1.TabStop = false;
@@ -392,7 +395,7 @@
            // 
            this.cmb_DataBase.FormattingEnabled = true;
            this.cmb_DataBase.Location = new System.Drawing.Point(775, 25);
            this.cmb_DataBase.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.cmb_DataBase.Margin = new System.Windows.Forms.Padding(4);
            this.cmb_DataBase.Name = "cmb_DataBase";
            this.cmb_DataBase.Size = new System.Drawing.Size(273, 23);
            this.cmb_DataBase.TabIndex = 2;
@@ -412,7 +415,7 @@
            // 
            this.cmb_DataSource.FormattingEnabled = true;
            this.cmb_DataSource.Location = new System.Drawing.Point(8, 25);
            this.cmb_DataSource.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.cmb_DataSource.Margin = new System.Windows.Forms.Padding(4);
            this.cmb_DataSource.Name = "cmb_DataSource";
            this.cmb_DataSource.Size = new System.Drawing.Size(273, 23);
            this.cmb_DataSource.TabIndex = 0;
@@ -420,6 +423,9 @@
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.label19);
            this.groupBox2.Controls.Add(this.label18);
            this.groupBox2.Controls.Add(this.tb_EnumList);
            this.groupBox2.Controls.Add(this.tb_GroupName);
            this.groupBox2.Controls.Add(this.label16);
            this.groupBox2.Controls.Add(this.label15);
@@ -451,10 +457,10 @@
            this.groupBox2.Controls.Add(this.tb_EntityName);
            this.groupBox2.Controls.Add(this.label7);
            this.groupBox2.Location = new System.Drawing.Point(68, 112);
            this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.groupBox2.Size = new System.Drawing.Size(1092, 588);
            this.groupBox2.Padding = new System.Windows.Forms.Padding(4);
            this.groupBox2.Size = new System.Drawing.Size(1293, 588);
            this.groupBox2.TabIndex = 46;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "自定义配置";
@@ -462,7 +468,7 @@
            // tb_GroupName
            // 
            this.tb_GroupName.Location = new System.Drawing.Point(467, 135);
            this.tb_GroupName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_GroupName.Margin = new System.Windows.Forms.Padding(4);
            this.tb_GroupName.Name = "tb_GroupName";
            this.tb_GroupName.Size = new System.Drawing.Size(243, 25);
            this.tb_GroupName.TabIndex = 50;
@@ -490,7 +496,7 @@
            // tb_ProjectNamePrefix
            // 
            this.tb_ProjectNamePrefix.Location = new System.Drawing.Point(139, 26);
            this.tb_ProjectNamePrefix.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_ProjectNamePrefix.Margin = new System.Windows.Forms.Padding(4);
            this.tb_ProjectNamePrefix.Name = "tb_ProjectNamePrefix";
            this.tb_ProjectNamePrefix.Size = new System.Drawing.Size(243, 25);
            this.tb_ProjectNamePrefix.TabIndex = 48;
@@ -514,7 +520,7 @@
            // tb_importExcelCategroy
            // 
            this.tb_importExcelCategroy.Location = new System.Drawing.Point(191, 108);
            this.tb_importExcelCategroy.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_importExcelCategroy.Margin = new System.Windows.Forms.Padding(4);
            this.tb_importExcelCategroy.Name = "tb_importExcelCategroy";
            this.tb_importExcelCategroy.Size = new System.Drawing.Size(149, 25);
            this.tb_importExcelCategroy.TabIndex = 50;
@@ -545,7 +551,7 @@
            // tb_templeteFileDownName
            // 
            this.tb_templeteFileDownName.Location = new System.Drawing.Point(191, 72);
            this.tb_templeteFileDownName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.tb_templeteFileDownName.Margin = new System.Windows.Forms.Padding(4);
            this.tb_templeteFileDownName.Name = "tb_templeteFileDownName";
            this.tb_templeteFileDownName.Size = new System.Drawing.Size(149, 25);
            this.tb_templeteFileDownName.TabIndex = 48;
@@ -560,11 +566,41 @@
            this.label14.TabIndex = 47;
            this.label14.Text = "文件下载名字:";
            // 
            // tb_EnumList
            //
            this.tb_EnumList.Location = new System.Drawing.Point(557, 451);
            this.tb_EnumList.Margin = new System.Windows.Forms.Padding(4);
            this.tb_EnumList.Multiline = true;
            this.tb_EnumList.Name = "tb_EnumList";
            this.tb_EnumList.Size = new System.Drawing.Size(491, 129);
            this.tb_EnumList.TabIndex = 51;
            //
            // label18
            //
            this.label18.AutoSize = true;
            this.label18.Location = new System.Drawing.Point(424, 488);
            this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(135, 15);
            this.label18.TabIndex = 52;
            this.label18.Text = "枚举类型字段集合:";
            //
            // label19
            //
            this.label19.AutoSize = true;
            this.label19.Location = new System.Drawing.Point(424, 432);
            this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(751, 15);
            this.label19.TabIndex = 53;
            this.label19.Text = "PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|Mate" +
    "rialTypeDesc";
            //
            // MainForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1236, 840);
            this.ClientSize = new System.Drawing.Size(1374, 840);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.btn_InsertSql);
@@ -572,7 +608,7 @@
            this.Controls.Add(this.btnExit);
            this.Controls.Add(this.tbPath);
            this.Controls.Add(this.btnPath);
            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.Margin = new System.Windows.Forms.Padding(4);
            this.Name = "MainForm";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "伟本-CMS-代码生成器(伟本专用)V1.0";
@@ -636,6 +672,9 @@
        private System.Windows.Forms.TextBox tb_GroupName;
        private System.Windows.Forms.ComboBox cmb_DataBase;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.Label label18;
        private System.Windows.Forms.TextBox tb_EnumList;
        private System.Windows.Forms.Label label19;
    }
}
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/MainForm.cs
@@ -32,8 +32,8 @@
            this.tb_FileName.Text = "Xiangzi";//文件前缀名
            this.tb_ChinaComment.Text = "物料基础信息表";//中文注释
            this.tb_CreatePerson.Text = "shaocx";//创建人
            this.tb_EntityName.Text = "WmsMaterials";//实体类名
            this.tb_EntityProName.Text = "_wmsMaterials";//实体类对象名
            this.tb_EntityName.Text = "WmsMaterial";//实体类名
            this.tb_EntityProName.Text = "_wmsMaterial";//实体类对象名
            this.cmb_DataSource.DropDownStyle = ComboBoxStyle.DropDownList;
            List<ListItem> itemList = CommonHelper.GetDataSources();
@@ -163,6 +163,24 @@
                    ColumnNameList = columnList,
                    EntityName = entityName
                };
                //处理枚举类型
                List<EnumModel> enumList = new List<EnumModel>();
                var str_enumList = this.tb_EnumList.Text.Trim();
                if (str_enumList.IndexOf(',') > -1)
                {
                    var arr_enumList = str_enumList.Split(',');
                    foreach (var item in arr_enumList)
                    {
                        var arr_single = item.Split('|');
                        enumList.Add(new EnumModel()
                        {
                            EnumAttrName = arr_single[0],
                            EnumType = arr_single[1],
                            EnumTypeDesc = arr_single[2]
                        });
                    }
                }
                param.EnumList = enumList;
                //生成Model
                //CreateModelFile(columnList, tableName, filePrefixName, wcf_NameSpacePath, createPerson, chinaComment, entityName, modulelogo);
@@ -186,6 +204,10 @@
                str_generate = CreateOrUpdateDtoBase_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(entityFilePath, $"{param.EntityName}CreateOrUpdateDtoBase.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
                //5、生成 Dto æ–‡ä»¶
                str_generate = Dto_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(entityFilePath, $"{param.EntityName}Dto.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
                #endregion
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Model/GenerateCodeParam.cs
@@ -36,5 +36,21 @@
        /// å‘½åç©ºé—´ 
        /// </summary>
        public string NameSpacePath { get; set; }
        /// <summary>
        /// ä½¿ç”¨çš„æžšä¸¾åˆ—表
        /// </summary>
        public List<EnumModel> EnumList { get; set; } = new List<EnumModel>();
    }
    public class EnumModel
    {
        /// <summary>
        /// æžšä¸¾å±žæ€§å
        /// </summary>
        public string EnumAttrName { get; set; }
        public string EnumType { get; set; }
        public string EnumTypeDesc { get; set; }
    }
}
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Templete/Entity/DtoÄ£°å.txt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
using CMS.Plugin.$NameSpacePath$.Domain.Shared.Enums;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
namespace CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$;
/// <summary>
/// $ChinaComment$数据参数对象
/// </summary>
public  class $EntityName$Dto:  ExtensibleEntityDto<Guid>, IHasConcurrencyStamp
{
    $AddAttributesForDto$
   /// <summary>
    /// å¹¶å‘戳
    /// </summary>
    public string ConcurrencyStamp { get; set; }
    /// <summary>
    /// Gets the export data.
    /// </summary>
    /// <returns></returns>
    public Dictionary<string, object> GetExportData()
    {
        var exportData = new Dictionary<string, object>();
        foreach (var property in this.GetType().GetProperties())
        {
            exportData.Add(property.Name, property.GetValue(this));
        }
        return exportData;
    }
}
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Utility/StructStrHelper.cs
@@ -1,8 +1,10 @@
using System;
using GenerateCode_WeiBen_WMS.Model;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
namespace GenerateCode_GEBrilliantFactory
@@ -216,7 +218,7 @@
        /// </summary>
        /// <param name="columnModel"></param>
        /// <returns></returns>
        public static string GenerateAttributeForAddModel(ColumnModel columnModel)
        public static string GenerateAttributeForAddModel(ColumnModel columnModel,GenerateCodeParam param)
        {
            try
            {
@@ -248,8 +250,17 @@
                        break;
                    case DataTypeEnum.dt_int:
                        if (columnModel.IsNullable) { str_NullFlag = "? "; }
                        attrStr += "        public int" + str_NullFlag + attr + " { get; set; }\n";
                        attrStr += "\n";//最后是加一个空格
                        var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                        if (findEnumObj != null)
                        {
                            attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
                            attrStr += "\n";//最后是加一个空格
                        }
                        else
                        {
                            attrStr += "        public int" + str_NullFlag + attr + " { get; set; }\n";
                            attrStr += "\n";//最后是加一个空格
                        }
                        break;
                    default:
                        attrStr += "        public string" + str_NullFlag + attr + " { get; set; }\n";
@@ -267,6 +278,90 @@
        }
        /// <summary>
        /// ç”Ÿæˆå±žæ€§å­—符串ForAddModel-Dto实体专用
        /// </summary>
        /// <param name="columnModel"></param>
        /// <returns></returns>
        public static string GenerateAttributeForDto(ColumnModel columnModel, GenerateCodeParam param)
        {
            try
            {
                string attr = columnModel.ColumnName;
                //if (attr.ToUpper() == "DBId".ToUpper())
                //{
                //    var bb = "";
                //}
                string str_NullFlag = " ";
                string attrStr = "";
                attrStr += "        /// <summary>\n";
                attrStr += "        /// " + columnModel.Description + "\n";
                attrStr += "        /// </summary>\n";
                DataTypeEnum myDataType = (DataTypeEnum)Enum.Parse(typeof(DataTypeEnum), "dt_" + columnModel.DataType);
                switch (myDataType)
                {
                    case DataTypeEnum.dt_datetime:
                    case DataTypeEnum.dt_datetime2:
                    case DataTypeEnum.dt_datetimeoffset:
                        attrStr += "        public datetime" + str_NullFlag + attr + " { get; set; }\n";
                        attrStr += "\n";//最后是加一个空格
                        break;
                    case DataTypeEnum.dt_bigint:
                        if (columnModel.IsNullable) { str_NullFlag = "? "; }
                        attrStr += "        public long" + str_NullFlag + attr + " { get; set; }\n";
                        attrStr += "\n";//最后是加一个空格
                        break;
                    case DataTypeEnum.dt_int:
                        if (columnModel.IsNullable) { str_NullFlag = "? "; }
                        var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                        if (findEnumObj != null)
                        {
                            attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
                            attrStr += "\n";//最后是加一个空格
                        }
                        else
                        {
                            attrStr += "        public int" + str_NullFlag + attr + " { get; set; }\n";
                            attrStr += "\n";//最后是加一个空格
                        }
                        break;
                    default:
                        attrStr += "        public string" + str_NullFlag + attr + " { get; set; }\n";
                        attrStr += "\n";//最后是加一个空格
                        break;
                }
                //增加对枚举类型的支持
                if (param.EnumList?.Count > 0)
                {
                    var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                    if (findEnumObj != null)
                    {
                        attrStr += "        /// <summary>\n";
                        attrStr += "        /// " + columnModel.Description + "\n";
                        attrStr += "        /// </summary>\n";
                        attrStr += "        public string" + str_NullFlag + findEnumObj.EnumTypeDesc + " { get; set; }\n";
                        attrStr += "        { \n";
                        attrStr += "            get \n";
                        attrStr += "            { \n";
                        attrStr += $"                return GetEnumDescriptionUtil.GetEnumDescription({findEnumObj.EnumAttrName}); \n";
                        attrStr += "            } \n";
                        attrStr += "        } \n";
                    }
                }
                return attrStr;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// ç”Ÿæˆå±žæ€§å­—符串ForQueryModel- æŸ¥è¯¢å®žä½“专用
        /// </summary>
        /// <param name="columnModel"></param>
Weben_CMSרÓôúÂëÉú³ÉÆ÷/°æ±¾ËµÃ÷.txt
@@ -2,4 +2,6 @@
V1.0
   1、创建 2025-04-29
枚举例子
PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|MaterialTypeDesc