From d04043960122cf87b43af6b081eaea2a71834ee9 Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周三, 07 5月 2025 11:16:42 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
---
Weben_CMS专用代码生成器/Code/MainForm.cs | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 52 insertions(+), 7 deletions(-)
diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs"
index ff60dcd..4742b52 100644
--- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs"
+++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs"
@@ -35,6 +35,10 @@
this.tb_PageMenuInstanceName.Text = "wmsMaterial";
this.tb_CreatePerson.Text = "shaocx";//鍒涘缓浜�
this.tb_EntityName.Text = "WmsMaterial";//瀹炰綋绫诲悕
+
+ this.tb_LikeQueryAttrs.Text = "'MaterialCode', 'MaterialName', 'Remark'";
+ this.tb_LikeQueryAttrsName.Text = "璇疯緭鍏ョ墿鏂欑紪鐮�/鐗╂枡鍚嶇О/澶囨敞";
+
//this.tb_EntityProName.Text = "wmsMaterial";//瀹炰綋绫诲璞″悕
this.tb_EnumList.Text = "PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|MaterialTypeDesc,IsMainBranch|YesNoEnum|IsMainBranchDesc";
@@ -99,6 +103,23 @@
string wcf_NameSpacePath = this.tb_WCF_NameSpacePath.Text.Trim();//WCF椤圭洰鍛藉悕绌洪棿
string filePrefixName = this.tb_FileName.Text.Trim();//鏂囦欢鍓嶇紑鍚�
string modulelogo = this.tb_Modulelogo.Text.Trim();//妯″潡绠�鍐�
+
+
+ string _tb_DeleteAlertAttr = this.tb_DeleteAlertAttr.Text.Trim();//涓枃娉ㄩ噴
+ if (_tb_DeleteAlertAttr == "")
+ {
+ MessageBox.Show("璇疯緭鍏� 鍒犻櫎鎻愮ず瀛楁锛�");
+ this.tb_DeleteAlertAttr.Focus();
+ return;
+ }
+
+ string _tb_ValidateRepeatName = this.tb_ValidateRepeatName.Text.Trim();//涓枃娉ㄩ噴
+ if (_tb_ValidateRepeatName == "")
+ {
+ MessageBox.Show("璇疯緭鍏� 閲嶅鎬ф牎楠屽瓧娈碉紒");
+ this.tb_ValidateRepeatName.Focus();
+ return;
+ }
string _tb_LikeQueryAttrsName = this.tb_LikeQueryAttrsName.Text.Trim();//涓枃娉ㄩ噴
if (_tb_LikeQueryAttrsName == "")
@@ -197,6 +218,7 @@
GenerateCodeParam param = new GenerateCodeParam()
{
+ DeleteAlertAttr = CommonHelper.FirstLowercase(_tb_DeleteAlertAttr),
Modulelogo = modulelogo,
ChinaComment = chinaComment,
PageMenuName = menuName,
@@ -206,17 +228,34 @@
EntityName = entityName,
EntityInstanceName = tableAlias,
LikeQueryAttrs = _tb_LikeQueryAttrs,
- LikeQueryAttrsName = _tb_LikeQueryAttrsName
+ LikeQueryAttrsName = _tb_LikeQueryAttrsName,
+ ValidateRepeatName = this.tb_ValidateRepeatName.Text
};
//澶勭悊鏋氫妇绫诲瀷
List<EnumModel> enumList = new List<EnumModel>();
var str_enumList = this.tb_EnumList.Text.Trim();
if (str_enumList.IndexOf(',') > -1)
{
+ str_enumList = str_enumList.Replace("\n","");
+ str_enumList = str_enumList.Replace("\t", "");
+ str_enumList = str_enumList.Replace("\r", "");
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]
+ });
+ }
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(str_enumList))
+ {
+ var arr_single = str_enumList.Split('|');
enumList.Add(new EnumModel()
{
EnumAttrName = arr_single[0],
@@ -345,15 +384,15 @@
//20銆佺敓鎴� Views\NameSpacePath 鏂囦欢
str_generate = NameSpacePath_Generate.CreateText(param);
- tf = TextHelper.Export2File_V2(webRootPath + @"\Views", $"{param.NameSpacePath}.tsx", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
+ tf = TextHelper.Export2File_V2(webRootPath + @"\Views", $"{param.EntityName}.tsx", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
//21銆佺敓鎴� Views\NameSpacePath_module 鏂囦欢
str_generate = NameSpacePath_module_Generate.CreateText(param);
- tf = TextHelper.Export2File_V2(webRootPath + @"\Views", $"{param.NameSpacePath}.module.scss", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
+ tf = TextHelper.Export2File_V2(webRootPath + @"\Views", $"{param.EntityName}.module.scss", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
//22銆佺敓鎴� Views\NameSpacePath_Config 鏂囦欢
- str_generate = NameSpacePath_Config_Generate.CreateText(param);
- tf = TextHelper.Export2File_V2(webRootPath + @"\Views\config", $"{param.NameSpacePath}.module.scss", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
+ str_generate = EntityNameClass_json_Generate.CreateText(param);
+ tf = TextHelper.Export2File_V2(webRootPath + @"\Views\config", $"{param.EntityName}.json", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
//23銆佺敓鎴� Views\NameSpacePath_Config 鏂囦欢
@@ -413,6 +452,12 @@
#endregion
+
+
+ //36銆佺敓鎴� AutoMapperProfile 鏂囦欢
+ var autoMapFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\MapperProfiles";
+ str_generate = AutoMapperProfile_Generate.CreateText(param);
+ tf = TextHelper.Export2File_V2(autoMapFilePath, param.EntityName + $"AutoMapperProfile.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
@@ -530,12 +575,12 @@
{
var moule_str = tableName.Substring(index + 1, tableName.Length - index - 1);
this.tb_Modulelogo.Text = moule_str;
- this.tb_EntityProName.Text = CommonHelper.TitleToLower(moule_str);
+ tb_PageMenuInstanceName.Text = this.tb_EntityProName.Text = CommonHelper.TitleToLower(moule_str);
}
else
{
this.tb_Modulelogo.Text = tableName;
- this.tb_EntityProName.Text = CommonHelper.TitleToLower(tableName);
+ tb_PageMenuInstanceName.Text = this.tb_EntityProName.Text = CommonHelper.TitleToLower(tableName);
}
}
}
--
Gitblit v1.9.3