From 8ba1eb16b0ab14ce77c0f62c5a4a3cd2dd1bf6bc Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 31 Dec 2021 11:25:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E6=97=97=E5=AF=BC=E5=85=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/HQ_H/HQ_H_PlatformCreateDto.cs | 2 +- .../Entities/HQ_H/HQ_H_PlatformImportDto.cs | 8 +-- .../Entities/HQ_M/HQ_M_PlatformImportDto.cs | 20 +++--- ...ttleAccountPermissionDefinitionProvider.cs | 6 ++ .../Permissions/SettleAccountPermissions.cs | 11 ++++ .../Entities/HQ_H/HQ_H_PlatformAppService.cs | 2 +- .../Entities/HQ_M/HQ_M_PlatformAppService.cs | 2 +- ...ttleAccountApplicationAutoMapperProfile.cs | 66 ++++++++++++++++++- ...AccountDbContextModelCreatingExtensions.cs | 53 +++++++++++++++ 9 files changed, 150 insertions(+), 20 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformCreateDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformCreateDto.cs index d4c75f01..44655097 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformCreateDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformCreateDto.cs @@ -8,7 +8,7 @@ using Win.Sfs.Shared; namespace Win.Sfs.SettleAccount.Entities.HQ_H { - public class HQ_H_PlatformCreateDto : ScrapClaimsDtoBase, IBranch + public class HQ_H_PlatformCreateDto : HQ_H_PlatformDtoBase, IBranch { public virtual Guid BranchId { get; set; } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs index 2382d3f8..38029a87 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs @@ -38,13 +38,13 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H /// /// 期间 /// - [ImporterHeader(Name = "期间")] - public string Period { set; get; } + //[ImporterHeader(Name = "期间")] + //public string Period { set; get; } /// /// 版本号 /// - [ImporterHeader(Name = "版本号")] - public string Version { set; get; } + //[ImporterHeader(Name = "版本号")] + //public string Version { set; get; } /// /// 看板号 /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_M/HQ_M_PlatformImportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_M/HQ_M_PlatformImportDto.cs index 9cfb2256..a8190c22 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_M/HQ_M_PlatformImportDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_M/HQ_M_PlatformImportDto.cs @@ -35,16 +35,16 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_M /// [ImporterHeader(Name = "会计年度")] public string Year { get; set; } - /// - /// 期间 - /// - [ImporterHeader(Name = "期间")] - public string Period { set; get; } - /// - /// 版本号 - /// - [ImporterHeader(Name = "版本号")] - public string Version { set; get; } + ///// + ///// 期间 + ///// + //[ImporterHeader(Name = "期间")] + //public string Period { set; get; } + ///// + ///// 版本号 + ///// + //[ImporterHeader(Name = "版本号")] + //public string Version { set; get; } /// /// 看板号 /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs index 956ec8d7..73cc08b4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs @@ -18,6 +18,12 @@ namespace Win.Sfs.SettleAccount bt_car.AddChild(SettleAccountPermissions.BT_Carlatform.Update, L("Update")); bt_car.AddChild(SettleAccountPermissions.BT_Carlatform.Delete, L("Delete")); + //红旗F平台导入 + var hq_f = myGroup.AddPermission(SettleAccountPermissions.HQ_FPlatform.Default, L("HQ_MPlatform")); + hq_f.AddChild(SettleAccountPermissions.HQ_FPlatform.Create, L("Create")); + hq_f.AddChild(SettleAccountPermissions.HQ_FPlatform.Update, L("Update")); + hq_f.AddChild(SettleAccountPermissions.HQ_FPlatform.Delete, L("Delete")); + //红旗M平台导入 var hq_m = myGroup.AddPermission(SettleAccountPermissions.HQ_MPlatform.Default, L("HQ_MPlatform")); hq_m.AddChild(SettleAccountPermissions.HQ_MPlatform.Create, L("Create")); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs index 6973346d..5bd07ac3 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs @@ -25,6 +25,17 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } + /// + /// 红旗M平台导入-权限 + /// + public static class HQ_FPlatform + { + public const string Default = GroupName + "." + nameof(HQ_FPlatform); + public const string Create = Default + "." + CreateStr; + public const string Update = Default + "." + UpdateStr; + public const string Delete = Default + "." + DeleteStr; + } + /// /// 红旗M平台导入-权限 /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs index bcee2efc..178e5fc1 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs @@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H { if (string.IsNullOrEmpty(itm.HQHKanBan)) { - checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的零件号{0},其类型标识{1}有空,请检查!", itm.MaterialCode, itm.HQHKanBan), string.Empty)); + checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的物料号{0},其看板号{1}有空,请检查!", itm.MaterialCode, itm.HQHKanBan), string.Empty)); } } var _id = GuidGenerator.Create(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_M/HQ_M_PlatformAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_M/HQ_M_PlatformAppService.cs index f254ac20..c0c13f65 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_M/HQ_M_PlatformAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_M/HQ_M_PlatformAppService.cs @@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_M { if (string.IsNullOrEmpty(itm.Type)) { - checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的零件号{0},其类型标识{1}有空,请检查!", itm.MaterialCode, itm.Type), string.Empty)); + checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的物料号{0},其看板号{1}有空,请检查!", itm.MaterialCode, itm.Type), string.Empty)); } } var _id = GuidGenerator.Create(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index be97ec9c..0d6ffb7d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -84,6 +84,8 @@ using Win.Sfs.SettleAccount.Entities.WMSKanBan; using Win.Sfs.SettleAccount.Entities.WMS_SparePart; using Win.Sfs.SettleAccount.Entities.WMSSparePart; using Win.Sfs.SettleAccount.Entities.HQ_H; +using Win.Sfs.SettleAccount.Entities.HQ_M; +using Win.Sfs.SettleAccount.Entities.HQ_F; namespace Win.Sfs.SettleAccount { @@ -225,12 +227,70 @@ namespace Win.Sfs.SettleAccount CreateMapHQ_H_Platform(); CreateMapHQ_H_PlatformVersion(); + //红旗M平台 + CreateMapHQ_M_Platform(); + CreateMapHQ_M_PlatformVersion(); + + //红旗F平台 + CreateMapHQ_F_Platform(); + CreateMapHQ_F_PlatformVersion(); + #endregion } #region PG-派格映射 + /// + /// 红旗F平台导入 + /// + private void CreateMapHQ_F_Platform() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + /// + /// 红旗F平台-版本 + /// + private void CreateMapHQ_F_PlatformVersion() + + { + CreateMap().ReverseMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } + + /// + /// 红旗M平台导入 + /// + private void CreateMapHQ_M_Platform() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + /// + /// 红旗M平台-版本 + /// + private void CreateMapHQ_M_PlatformVersion() + { + CreateMap().ReverseMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } /// /// 红旗H平台导入 /// @@ -250,9 +310,9 @@ namespace Win.Sfs.SettleAccount private void CreateMapHQ_H_PlatformVersion() { - CreateMap().ReverseMap(); - CreateMap(); - CreateMap(); + CreateMap().ReverseMap(); + CreateMap(); + CreateMap(); CreateMap (); CreateMap (); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 4ccd9fa6..d1c2a7df 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -71,6 +71,7 @@ using Win.Sfs.SettleAccount.Entities.HQ_H; using Win.Sfs.SettleAccount.Entities.HQ_M; using Win.Sfs.SettleAccount.Entities.BT_Car; using Win.Sfs.SettleAccount.Entities.WMS; +using Win.Sfs.SettleAccount.Entities.HQ_F; namespace Win.Sfs.SettleAccount { @@ -310,6 +311,10 @@ namespace Win.Sfs.SettleAccount builder.ConfigureHQH(options); builder.ConfigureHQHVersion(options); + //红旗F平台 + builder.ConfigureHQF(options); + builder.ConfigureHQFVersion(options); + //红旗M平台 builder.ConfigureHQM(options); builder.ConfigureHQMVersion(options); @@ -324,6 +329,54 @@ namespace Win.Sfs.SettleAccount #region PG-派格 + /// + /// 红旗工厂F平台验收结算明细-导入 + /// + /// + /// + private static void ConfigureHQF(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + + b.ToTable($"{options.TablePrefix}_HQ_F_Platform", options.Schema); + + b.ConfigureByConvention(); + b.Property(x => x.HQHKanBan).IsRequired().HasMaxLength(150);//必填项 + b.Property(x => x.MaterialVoucherNo).HasMaxLength(150); + b.Property(x => x.Factory).HasMaxLength(50); + b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150); + b.Property(x => x.ExternalKanbanNumber).HasMaxLength(50); + b.Property(x => x.KanbanNumber).HasMaxLength(150); + b.Property(x => x.Period).HasMaxLength(50); + b.Property(x => x.Year).HasMaxLength(50); + b.Property(x => x.Version).HasMaxLength(50); + b.Property(x => x.Supplier).HasMaxLength(50); + b.Property(x => x.StorageLocation).HasMaxLength(50); + b.Property(x => x.StorageLocationDesc).HasMaxLength(150); + //创建组合索引 + b.HasIndex(x => new { x.Version, x.HQHKanBan, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); + + }); + } + + private static void ConfigureHQFVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_HQ_F_PlatformVersion", options.Schema); + b.ConfigureByConvention(); + b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); + b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); + b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); + b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); + b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter); + }); + + } + /// /// 一汽轿车-导入 ///