Browse Source

红旗导入功能代码

branch_ccpg_220107
44673626 3 years ago
parent
commit
8ba1eb16b0
  1. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformCreateDto.cs
  2. 8
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs
  3. 20
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_M/HQ_M_PlatformImportDto.cs
  4. 6
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs
  5. 11
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs
  6. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs
  7. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_M/HQ_M_PlatformAppService.cs
  8. 66
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  9. 53
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

2
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<Guid>
public class HQ_H_PlatformCreateDto : HQ_H_PlatformDtoBase, IBranch<Guid>
{
public virtual Guid BranchId { get; set; }
}

8
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
/// <summary>
/// 期间
/// </summary>
[ImporterHeader(Name = "期间")]
public string Period { set; get; }
//[ImporterHeader(Name = "期间")]
//public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
[ImporterHeader(Name = "版本号")]
public string Version { set; get; }
//[ImporterHeader(Name = "版本号")]
//public string Version { set; get; }
/// <summary>
/// 看板号
/// </summary>

20
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
/// </summary>
[ImporterHeader(Name = "会计年度")]
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
[ImporterHeader(Name = "期间")]
public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
[ImporterHeader(Name = "版本号")]
public string Version { set; get; }
///// <summary>
///// 期间
///// </summary>
//[ImporterHeader(Name = "期间")]
//public string Period { set; get; }
///// <summary>
///// 版本号
///// </summary>
//[ImporterHeader(Name = "版本号")]
//public string Version { set; get; }
/// <summary>
/// 看板号
/// </summary>

6
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"));

11
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs

@ -25,6 +25,17 @@ namespace Win.Sfs.SettleAccount
public const string Delete = Default + "." + DeleteStr;
}
/// <summary>
/// 红旗M平台导入-权限
/// </summary>
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;
}
/// <summary>
/// 红旗M平台导入-权限
/// </summary>

2
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();

2
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();

66
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-派格映射
/// <summary>
/// 红旗F平台导入
/// </summary>
private void CreateMapHQ_F_Platform()
{
CreateMap<HQ_F_Platform, HQ_F_PlatformDto>().ReverseMap();
CreateMap<HQ_F_Platform, HQ_F_PlatformRequestDto>().ReverseMap();
CreateMap<HQ_F_Platform, HQ_F_PlatformImportDto>().ReverseMap();
CreateMap<HQ_F_Platform, HQ_F_PlatformExportDto>().ReverseMap();
CreateMap<HQ_F_Platform, HQ_F_PlatformExportDto>().ReverseMap();
}
/// <summary>
/// 红旗F平台-版本
/// </summary>
private void CreateMapHQ_F_PlatformVersion()
{
CreateMap<HQ_F_PlatformVersion, HQ_F_PlatformVersionDto>().ReverseMap();
CreateMap<HQ_F_PlatformVersion, HQ_F_PlatformVersionCreateDto>();
CreateMap<HQ_F_PlatformVersion, HQ_F_PlatformVersionUpdateDto>();
CreateMap<HQ_F_PlatformVersionCreateDto, HQ_F_PlatformVersion>();
CreateMap<HQ_F_PlatformVersionUpdateDto, HQ_F_PlatformVersion>();
}
/// <summary>
/// 红旗M平台导入
/// </summary>
private void CreateMapHQ_M_Platform()
{
CreateMap<HQ_M_Platform, HQ_M_PlatformDto>().ReverseMap();
CreateMap<HQ_M_Platform, HQ_M_PlatformRequestDto>().ReverseMap();
CreateMap<HQ_M_Platform, HQ_M_PlatformImportDto>().ReverseMap();
CreateMap<HQ_M_Platform, HQ_M_PlatformExportDto>().ReverseMap();
CreateMap<HQ_M_Platform, HQ_M_PlatformExportDto>().ReverseMap();
}
/// <summary>
/// 红旗M平台-版本
/// </summary>
private void CreateMapHQ_M_PlatformVersion()
{
CreateMap<HQ_M_PlatformVersion, HQ_M_PlatformVersionDto>().ReverseMap();
CreateMap<HQ_M_PlatformVersion, HQ_M_PlatformVersionCreateDto>();
CreateMap<HQ_M_PlatformVersion, HQ_M_PlatformVersionUpdateDto>();
CreateMap<HQ_M_PlatformVersionCreateDto, HQ_M_PlatformVersion>();
CreateMap<HQ_M_PlatformVersionUpdateDto, HQ_M_PlatformVersion>();
}
/// <summary>
/// 红旗H平台导入
/// </summary>
@ -250,9 +310,9 @@ namespace Win.Sfs.SettleAccount
private void CreateMapHQ_H_PlatformVersion()
{
CreateMap<HQ_H_PlatformVersion, SparePartVersionDto>().ReverseMap();
CreateMap<HQ_H_PlatformVersion, SparePartVersionCreateDto>();
CreateMap<HQ_H_PlatformVersion, SparePartVersionUpdateDto>();
CreateMap<HQ_H_PlatformVersion, HQ_H_PlatformVersionDto>().ReverseMap();
CreateMap<HQ_H_PlatformVersion, HQ_H_PlatformVersionCreateDto>();
CreateMap<HQ_H_PlatformVersion, HQ_H_PlatformVersionUpdateDto>();
CreateMap <HQ_H_PlatformVersionCreateDto,HQ_H_PlatformVersion > ();
CreateMap <HQ_H_PlatformVersionUpdateDto, HQ_H_PlatformVersion > ();
}

53
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-派格
/// <summary>
/// 红旗工厂F平台验收结算明细-导入
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
private static void ConfigureHQF(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<HQ_F_Platform>(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<HQ_F_PlatformVersion>(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);
});
}
/// <summary>
/// 一汽轿车-导入
/// </summary>

Loading…
Cancel
Save