Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
已添加1个文件
已重命名2个文件
已修改19个文件
已复制1个文件
| | |
| | | } |
| | | str = str.Replace("$UpdateAttributesForCheckCreateOrUpdateDtoAsync$", attrString); |
| | | |
| | | |
| | | |
| | | attrString = ""; |
| | | for (int i = 0; i < newColumnNameList.Count; ++i) |
| | | { |
| | | attrString += StructStrHelper.GenerateAttribute_AppService_ImportAsync(newColumnNameList[i], param); |
| | | } |
| | | str = str.Replace("$AppService_ImportAsync$", attrString); |
| | | |
| | | return str; |
| | | } |
| | | } |
copy from "Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Generate/Web/Views/config/NameSpacePath_Config_Generate.cs"
copy to "Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Generate/Application/MapperProfiles/AutoMapperProfile_Generate.cs"
Îļþ´Ó Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Web/Views/config/NameSpacePath_Config_Generate.cs ¸´ÖÆ |
| | |
| | | /// <summary> |
| | | /// çææ¥è¯¢å®ä½ç±» |
| | | /// </summary> |
| | | public class NameSpacePath_Config_Generate : BaseGenerate |
| | | public class AutoMapperProfile_Generate : BaseGenerate |
| | | { |
| | | public static string CreateText(GenerateCodeParam param) |
| | | { |
| | | var str = TextHelper.ReadText(@"Templete\Web\Views\config\NameSpacePath_Config模æ¿.txt"); |
| | | var str = TextHelper.ReadText(@"Templete\Application\MapperProfiles\AutoMapperProfile模æ¿.txt"); |
| | | CommonReplace(ref str); |
| | | |
| | | CommonHelper.CommonReplaceStr(param, ref str); |
ÎļþÃû´Ó Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Web/Views/config/NameSpacePath_Config_Generate.cs ÐÞ¸Ä |
| | |
| | | /// <summary> |
| | | /// çææ¥è¯¢å®ä½ç±» |
| | | /// </summary> |
| | | public class NameSpacePath_Config_Generate : BaseGenerate |
| | | public class EntityNameClass_json_Generate : BaseGenerate |
| | | { |
| | | public static string CreateText(GenerateCodeParam param) |
| | | { |
| | | var str = TextHelper.ReadText(@"Templete\Web\Views\config\NameSpacePath_Config模æ¿.txt"); |
| | | var str = TextHelper.ReadText(@"Templete\Web\Views\config\EntityNameClass_json模æ¿.txt"); |
| | | CommonReplace(ref str); |
| | | |
| | | CommonHelper.CommonReplaceStr(param, ref str); |
| | |
| | | <Compile Include="DataBaseFactory\DataBaseServiceFactory.cs" /> |
| | | <Compile Include="DataBaseFactory\Default\SqlServerDataBaseServiceHandle.cs" /> |
| | | <Compile Include="DataBaseFactory\Default\MySqlDataBaseServiceHandle.cs" /> |
| | | <Compile Include="Generate\Application\MapperProfiles\AutoMapperProfile_Generate.cs" /> |
| | | <Compile Include="Generate\AppService\AppService_Generate.cs" /> |
| | | <Compile Include="Generate\AppService\IAppService_Generate.cs" /> |
| | | <Compile Include="Generate\BaseGenerate.cs" /> |
| | |
| | | <Compile Include="Generate\Web\Models\Models_EntityNameClassDrawer_Generate.cs" /> |
| | | <Compile Include="Generate\Web\Models\Models_EntityNameClassQueryDrawer_Generate.cs" /> |
| | | <Compile Include="Generate\Web\type\File_Generate.cs" /> |
| | | <Compile Include="Generate\Web\Views\config\NameSpacePath_Config_Generate.cs" /> |
| | | <Compile Include="Generate\Web\Views\config\EntityNameClass_json_Generate.cs" /> |
| | | <Compile Include="Generate\Web\Views\NameSpacePath_module_Generate.cs" /> |
| | | <Compile Include="Generate\Web\Views\NameSpacePath_Generate.cs" /> |
| | | <Compile Include="Generate\Web\Views\Pages\Dialog\EntityNameClassDrawer\EntityNameClassDrawer_Generate.cs" /> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Content Include="Robot.ico" /> |
| | | <Content Include="Templete\Application\MapperProfiles\AutoMapperProfile模æ¿.txt"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | <Content Include="Templete\AppService\AppService模æ¿.txt"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | |
| | | <Content Include="Templete\Web\type\type模æ¿.txt"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | <Content Include="Templete\Web\Views\config\NameSpacePath_Config模æ¿.txt"> |
| | | <Content Include="Templete\Web\Views\config\EntityNameClass_json模æ¿.txt"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | <Content Include="Templete\Web\Views\NameSpacePath_module模æ¿.txt"> |
| | |
| | | this.lbl_DataSource = new System.Windows.Forms.Label(); |
| | | this.cmb_DataSource = new System.Windows.Forms.ComboBox(); |
| | | this.groupBox2 = new System.Windows.Forms.GroupBox(); |
| | | this.tb_ValidateRepeatName = new System.Windows.Forms.TextBox(); |
| | | this.label24 = new System.Windows.Forms.Label(); |
| | | this.tb_LikeQueryAttrsName = new System.Windows.Forms.TextBox(); |
| | | this.label23 = new System.Windows.Forms.Label(); |
| | | this.tb_LikeQueryAttrs = new System.Windows.Forms.TextBox(); |
| | |
| | | this.label12 = new System.Windows.Forms.Label(); |
| | | this.tb_templeteFileDownName = new System.Windows.Forms.TextBox(); |
| | | this.label14 = new System.Windows.Forms.Label(); |
| | | this.label25 = new System.Windows.Forms.Label(); |
| | | this.tb_DeleteAlertAttr = new System.Windows.Forms.TextBox(); |
| | | this.groupBox1.SuspendLayout(); |
| | | this.groupBox2.SuspendLayout(); |
| | | this.groupBox3.SuspendLayout(); |
| | |
| | | // |
| | | // groupBox2 |
| | | // |
| | | this.groupBox2.Controls.Add(this.tb_DeleteAlertAttr); |
| | | this.groupBox2.Controls.Add(this.label25); |
| | | this.groupBox2.Controls.Add(this.tb_ValidateRepeatName); |
| | | this.groupBox2.Controls.Add(this.label24); |
| | | this.groupBox2.Controls.Add(this.tb_LikeQueryAttrsName); |
| | | this.groupBox2.Controls.Add(this.label23); |
| | | this.groupBox2.Controls.Add(this.tb_LikeQueryAttrs); |
| | |
| | | this.groupBox2.TabIndex = 46; |
| | | this.groupBox2.TabStop = false; |
| | | this.groupBox2.Text = "èªå®ä¹é
ç½®"; |
| | | // |
| | | // tb_ValidateRepeatName |
| | | // |
| | | this.tb_ValidateRepeatName.Location = new System.Drawing.Point(402, 108); |
| | | this.tb_ValidateRepeatName.Name = "tb_ValidateRepeatName"; |
| | | this.tb_ValidateRepeatName.Size = new System.Drawing.Size(145, 21); |
| | | this.tb_ValidateRepeatName.TabIndex = 63; |
| | | // |
| | | // label24 |
| | | // |
| | | this.label24.AutoSize = true; |
| | | this.label24.Location = new System.Drawing.Point(298, 114); |
| | | this.label24.Name = "label24"; |
| | | this.label24.Size = new System.Drawing.Size(95, 12); |
| | | this.label24.TabIndex = 62; |
| | | this.label24.Text = "é夿§æ ¡éªå段:"; |
| | | // |
| | | // tb_LikeQueryAttrsName |
| | | // |
| | |
| | | // |
| | | // tb_GroupName |
| | | // |
| | | this.tb_GroupName.Location = new System.Drawing.Point(350, 108); |
| | | this.tb_GroupName.Location = new System.Drawing.Point(973, 111); |
| | | this.tb_GroupName.Name = "tb_GroupName"; |
| | | this.tb_GroupName.Size = new System.Drawing.Size(183, 21); |
| | | this.tb_GroupName.TabIndex = 50; |
| | |
| | | // label16 |
| | | // |
| | | this.label16.AutoSize = true; |
| | | this.label16.Location = new System.Drawing.Point(298, 111); |
| | | this.label16.Location = new System.Drawing.Point(920, 117); |
| | | this.label16.Name = "label16"; |
| | | this.label16.Size = new System.Drawing.Size(47, 12); |
| | | this.label16.TabIndex = 49; |
| | |
| | | this.label14.Size = new System.Drawing.Size(83, 12); |
| | | this.label14.TabIndex = 47; |
| | | this.label14.Text = "æä»¶ä¸è½½åå:"; |
| | | // |
| | | // label25 |
| | | // |
| | | this.label25.AutoSize = true; |
| | | this.label25.Location = new System.Drawing.Point(452, 255); |
| | | this.label25.Name = "label25"; |
| | | this.label25.Size = new System.Drawing.Size(83, 12); |
| | | this.label25.TabIndex = 64; |
| | | this.label25.Text = "å é¤æç¤ºåæ®µ:"; |
| | | // |
| | | // tb_DeleteAlertAttr |
| | | // |
| | | this.tb_DeleteAlertAttr.Location = new System.Drawing.Point(552, 246); |
| | | this.tb_DeleteAlertAttr.Name = "tb_DeleteAlertAttr"; |
| | | this.tb_DeleteAlertAttr.Size = new System.Drawing.Size(145, 21); |
| | | this.tb_DeleteAlertAttr.TabIndex = 65; |
| | | // |
| | | // MainForm |
| | | // |
| | |
| | | private System.Windows.Forms.TextBox tb_LikeQueryAttrs; |
| | | private System.Windows.Forms.Label label23; |
| | | private System.Windows.Forms.TextBox tb_LikeQueryAttrsName; |
| | | private System.Windows.Forms.TextBox tb_ValidateRepeatName; |
| | | private System.Windows.Forms.Label label24; |
| | | private System.Windows.Forms.TextBox tb_DeleteAlertAttr; |
| | | private System.Windows.Forms.Label label25; |
| | | } |
| | | } |
| | | |
| | |
| | | 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 == "") |
| | | { |
| | |
| | | |
| | | GenerateCodeParam param = new GenerateCodeParam() |
| | | { |
| | | DeleteAlertAttr = CommonHelper.FirstLowercase(_tb_DeleteAlertAttr), |
| | | Modulelogo = modulelogo, |
| | | ChinaComment = chinaComment, |
| | | PageMenuName = menuName, |
| | |
| | | EntityName = entityName, |
| | | EntityInstanceName = tableAlias, |
| | | LikeQueryAttrs = _tb_LikeQueryAttrs, |
| | | LikeQueryAttrsName = _tb_LikeQueryAttrsName |
| | | LikeQueryAttrsName = _tb_LikeQueryAttrsName, |
| | | ValidateRepeatName = this.tb_ValidateRepeatName.Text |
| | | }; |
| | | //å¤çæä¸¾ç±»å |
| | | List<EnumModel> enumList = new List<EnumModel>(); |
| | |
| | | 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.EntityName}.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 æä»¶ |
| | |
| | | #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); |
| | | |
| | | |
| | | |
| | | ////çæ OutputModel æä»¶ |
| | | //str_generate = OutputModel_Generate.CreateQueryModelLText(modulelogo, chinaComment, columnList, entityName); |
| | |
| | | public class GenerateCodeParam |
| | | { |
| | | /// <summary> |
| | | /// å é¤æç¤ºåæ®µ |
| | | /// </summary> |
| | | public string DeleteAlertAttr { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 模åç®å |
| | | /// </summary> |
| | | public string Modulelogo { get; set; } |
| | |
| | | public string PageMenuInstanceName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 页é¢èå对象缩å |
| | | /// </summary> |
| | | public string ValidateRepeatName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååå表 |
| | | /// </summary> |
| | | public List<ColumnModel> ColumnNameList { get; set; } = new List<ColumnModel>(); |
| | |
| | | public const string c_ConcurrencyStamp = "ConcurrencyStamp"; |
| | | |
| | | public const string c_Sort = "Sort"; |
| | | |
| | | public const string c_IsDisabled = "IsDisabled"; |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using CMS.Plugin.$NameSpacePath$.Application.Contracts.Services; |
| | | using CMS.Plugin.$NameSpacePath$.Domain.Shared; |
| | | using CMS.Plugin.$NameSpacePath$.Domain.Shared.Util; |
| | | using CMS.Plugin.$NameSpacePath$.Domain.Shared.$EntityName$; |
| | | using CMS.Plugin.$NameSpacePath$.Domain.$EntityName$; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await $EntityInstanceName$Repository.NameExistAsync(input.MaterialCode); |
| | | var exist = await $EntityInstanceName$Repository.NameExistAsync(input.$ValidateRepeatName$); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialCode]); |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.$ValidateRepeatName$]); |
| | | } |
| | | |
| | | var maxSort = await $EntityInstanceName$Repository.GetMaxSortAsync(); |
| | |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await $EntityInstanceName$Repository.GetAsync(id); |
| | | var exist = await $EntityInstanceName$Repository.NameExistAsync(input.MaterialCode, updateObj.Id); |
| | | var exist = await $EntityInstanceName$Repository.NameExistAsync(input.$ValidateRepeatName$, updateObj.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialCode]); |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.$ValidateRepeatName$]); |
| | | } |
| | | |
| | | updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicate$EntityName$s = importItems.GroupBy(x => x.MaterialCode).Where(x => x.Count() > 1).ToList(); |
| | | var duplicate$EntityName$s = importItems.GroupBy(x => x.$ValidateRepeatName$).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicate$EntityName$s?.Any() == true) |
| | | { |
| | | var duplicate$EntityName$Msgs = duplicate$EntityName$s.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.MaterialCode.IsNullOrWhiteSpace() && impItem.MaterialName.IsNullOrWhiteSpace()) |
| | | if (impItem.$ValidateRepeatName$.IsNullOrWhiteSpace() && impItem.MaterialName.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (impItem.MaterialCode.IsNullOrWhiteSpace()) |
| | | if (impItem.$ValidateRepeatName$.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{impItem.RowIndex}è¡ï¼$EntityName$åç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var old$EntityName$ = await $EntityInstanceName$Repository.FindByNameAsync(impItem.MaterialCode); |
| | | var old$EntityName$ = await $EntityInstanceName$Repository.FindByNameAsync(impItem.$ValidateRepeatName$); |
| | | if (old$EntityName$ != null) |
| | | { |
| | | var $EntityInstanceName$UpdateDto = new $EntityName$UpdateDto |
| | | { |
| | | MaterialCode = impItem.MaterialCode, |
| | | MaterialName = impItem.MaterialName, |
| | | PurchaseType = impItem.PurchaseType, |
| | | MaterialType = impItem.MaterialType, |
| | | PrimaryUnit = impItem.PrimaryUnit, |
| | | Standard = impItem.Standard, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | WallThickness = impItem.WallThickness, |
| | | MaterialQuality = impItem.MaterialQuality, |
| | | Length = impItem.Length, |
| | | IsMainBranch = impItem.IsMainBranch, |
| | | Factory = impItem.Factory, |
| | | Certification = impItem.Certification, |
| | | Remark = impItem.Remark, |
| | | $AppService_ImportAsync$ |
| | | }; |
| | | |
| | | $EntityInstanceName$UpdateDtos.Add((impItem.RowIndex, old$EntityName$.Id, $EntityInstanceName$UpdateDto)); |
| | |
| | | { |
| | | var $EntityInstanceName$CreateDto = new $EntityName$CreateDto |
| | | { |
| | | MaterialCode = impItem.MaterialCode, |
| | | MaterialName = impItem.MaterialName, |
| | | PurchaseType = impItem.PurchaseType, |
| | | MaterialType = impItem.MaterialType, |
| | | PrimaryUnit = impItem.PrimaryUnit, |
| | | Standard = impItem.Standard, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | WallThickness = impItem.WallThickness, |
| | | MaterialQuality = impItem.MaterialQuality, |
| | | Length = impItem.Length, |
| | | IsMainBranch = impItem.IsMainBranch, |
| | | Factory = impItem.Factory, |
| | | Certification = impItem.Certification, |
| | | Remark = impItem.Remark, |
| | | $AppService_ImportAsync$ |
| | | }; |
| | | |
| | | $EntityInstanceName$CreateDtos.Add((impItem.RowIndex, $EntityInstanceName$CreateDto)); |
| | |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "$EntityName$å表" : result.Count == 1 ? result[0]?.MaterialCode : "$EntityName$模ç"; |
| | | var fileName = result.Count > 1 ? "$ChinaComment$å表" : result.Count == 1 ? result[0]?.$ValidateRepeatName$ : "$EntityName$模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; |
| | | using CMS.Plugin.$NameSpacePath$.Domain.$EntityName$; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.$NameSpacePath$.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// $ChinaComment$AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class $EntityName$AutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="$EntityName$AutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public $EntityName$AutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<$EntityName$, $EntityName$Dto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<$EntityName$CreateDto, $EntityName$>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<Get$EntityName$Input, $EntityName$>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
| | |
| | | using CMS.Plugin.$NameSpacePath$.Domain.Shared.Enums; |
| | | using System; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; |
| | |
| | | using MiniExcelLibs.Attributes; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System; |
| | | using System.ComponentModel; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.$NameSpacePath$.Domain.Shared.Enums; |
| | | namespace CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; |
| | | |
| | | /// <summary> |
| | |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.MaterialCode == name, GetCancellationToken(cancellationToken)); |
| | | .FirstOrDefaultAsync(t => t.$ValidateRepeatName$ == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨$ChinaComment$ |
| | | /// </summary> |
| | | /// <param name="materialCode"></param> |
| | | /// <param name="name">æ ¡éªå¼</param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> NameExistAsync(string materialCode, Guid? id = null) |
| | | public async Task<bool> NameExistAsync(string name, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.MaterialCode == materialCode); |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.$ValidateRepeatName$ == name); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | const commonGetFormData=()=>{ |
| | | const data = { |
| | | $Save_PageAddFormAttributes_Query$ |
| | | materialCode: formData.value.materialCode, |
| | | materialName: formData.value.materialName, |
| | | purchaseType: formData.value.purchaseType, |
| | | materialType: formData.value.materialType, |
| | | primaryUnit: formData.value.primaryUnit, |
| | | standard: formData.value.standard, |
| | | outerDiameter: formData.value.outerDiameter, |
| | | wallThickness: formData.value.wallThickness, |
| | | materialQuality: formData.value.materialQuality, |
| | | length: formData.value.length, |
| | | isMainBranch: formData.value.isMainBranch, |
| | | factory: formData.value.factory, |
| | | certification: formData.value.certification, |
| | | remark: formData.value.remark, |
| | | } |
| | | return data; |
| | | } |
| | |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { name: string }) => item.name) |
| | | const names = selection.value.map((item: { $DeleteAlertAttr$: string }) => item.$DeleteAlertAttr$) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.$DeleteAlertAttr$}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await $PageMenuInstanceName$.delete$EntityName$s(ids.length ? ids : [c.row.id]) |
| | |
| | | */ |
| | | const onExport = (data={}) => { |
| | | //const params = tableRef.value?.getParams() |
| | | exportFile('/api/v1/hIAWms/$PageMenuInstanceName$/export', data, 'hIAWms') |
| | | exportFile('/api/v1/$NameSpacePath$/$PageMenuInstanceName$/export', data, '$NameSpacePath$') |
| | | } |
| | | |
| | | /** |
| | |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterial: {}, |
| | | $PageMenuInstanceName$: {}, |
| | | }) |
| | | } |
| | | |
| | |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterial: {}, |
| | | $PageMenuInstanceName$: {}, |
| | | }) |
| | | } |
| | | |
| | |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | export const add$EntityName$ = (data: any) => { |
| | | return request.post('/api/v1/$NameSpacePath$/$PageMenuInstanceName$', data) |
| | | } |
| | | |
| | |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterials = (ids: string[]) => { |
| | | export const delete$EntityName$s = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/$NameSpacePath$/$PageMenuInstanceName$', |
| | |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | export const add$EntityName$ = (data: any) => { |
| | | return request.post('/api/v1/$NameSpacePath$/$PageMenuInstanceName$', data) |
| | | } |
| | | |
| | |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterial = (id: string) => { |
| | | export const get$EntityName$ = (id: string) => { |
| | | return request.get(`/api/v1/$NameSpacePath$/$PageMenuInstanceName$/${id}`) |
| | | } |
| | | |
| | |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterial = (id: string, data: Record<string, any>) => { |
| | | export const update$EntityName$ = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/$NameSpacePath$/$PageMenuInstanceName$/${id}`, data) |
| | | } |
| | | |
| | |
| | | |
| | | str = str.Replace("$LikeQueryAttrs$", param.LikeQueryAttrs); |
| | | str = str.Replace("$LikeQueryAttrsName$", param.LikeQueryAttrsName); |
| | | str = str.Replace("$ValidateRepeatName$", param.ValidateRepeatName); |
| | | str = str.Replace("$DeleteAlertAttr$", param.DeleteAlertAttr); |
| | | |
| | | } |
| | | |
| | |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_CreateId.ToUpper() |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_ModifyId.ToUpper() |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_Sort.ToUpper() |
| | | |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_IsDisabled.ToUpper() |
| | | ) |
| | | { |
| | | continue; |
| | |
| | | return newList; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 页é¢è¡¨æ ¼å±ç¤ºç åæ®µå表 |
| | | /// </summary> |
| | | /// <param name="columnNameList"></param> |
| | | /// <returns></returns> |
| | | public static List<ColumnModel> RemoveForPageTableListQueryAttributes(List<ColumnModel> columnNameList) |
| | | { |
| | | List<ColumnModel> newList = new List<ColumnModel>(); |
| | |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_delFlag.ToUpper() |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_CreateId.ToUpper() |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_ModifyId.ToUpper() |
| | | || columnModel.ColumnName.ToUpper() == SystemCommonVar.c_IsDisabled.ToUpper() |
| | | //|| columnModel.ColumnName.ToUpper() == SystemCommonVar.c_Sort.ToUpper() |
| | | |
| | | ) |
| | |
| | | case DataTypeEnum.dt_datetime: |
| | | case DataTypeEnum.dt_datetime2: |
| | | case DataTypeEnum.dt_datetimeoffset: |
| | | attrStr += " public datetime" + str_NullFlag + attr + " { get; set; }\n"; |
| | | attrStr += " public DateTime" + str_NullFlag + attr + " { get; set; }\n"; |
| | | attrStr += "\n";//æåæ¯å ä¸ä¸ªç©ºæ ¼ |
| | | break; |
| | | case DataTypeEnum.dt_bigint: |
| | |
| | | |
| | | string attrStr = ""; |
| | | attrStr += $" updateObj.{attr} = input.{attr};\n"; |
| | | |
| | | |
| | | return attrStr; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static string GenerateAttribute_AppService_ImportAsync(ColumnModel columnModel, GenerateCodeParam param) |
| | | { |
| | | try |
| | | { |
| | | /* |
| | | |
| | | MaterialCode = impItem.MaterialCode, |
| | | |
| | | */ |
| | | string attr = columnModel.ColumnName; |
| | | |
| | | string attrStr = ""; |
| | | attrStr += $"{attr} = impItem.{attr},\n"; |
| | | |
| | | |
| | | return attrStr; |
| | |
| | | case DataTypeEnum.dt_datetime: |
| | | case DataTypeEnum.dt_datetime2: |
| | | case DataTypeEnum.dt_datetimeoffset: |
| | | attrStr += " public datetime" + str_NullFlag + attr + " { get; set; }\n"; |
| | | attrStr += " public DateTime" + str_NullFlag + attr + " { get; set; }\n"; |
| | | attrStr += "\n";//æåæ¯å ä¸ä¸ªç©ºæ ¼ |
| | | break; |
| | | case DataTypeEnum.dt_bigint: |
| | |
| | | |
| | | sb.Append(" //disabled: disabled, \n"); |
| | | sb.Append(" placeholder: '请è¾å
¥" + columnModel.Description + "', \n"); |
| | | |
| | | |
| | | //æ·»å ç±»å |
| | | //switch (enumDT) |
| | | //{ |
| | |
| | | /* |
| | | isMainBranch: [] as Array<{ label: string; value: any }>, |
| | | */ |
| | | if (param.EnumList?.Count > 0) |
| | | if (param.EnumList?.Count > 0) |
| | | { |
| | | foreach (var item in param.EnumList) |
| | | { |