diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs index e234a994..c408608a 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -7455,6 +7455,217 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_TaskJob"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptanceDate") + .HasColumnType("datetime2"); + + b.Property("AcceptanceNo") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalKanbanNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HQHKanBan") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KanbanNumber") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialVoucherNo") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("StorageLocationDesc") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Supplier") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_UnHQSettleAccount"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAccountVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_UnHQSettleAccountVersion"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWKanBan.KanBanSettle", b => { b.Property("Id") @@ -9511,7 +9722,7 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_WmsHQMSharePartOutPutDetial"); }); - modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPut", b => + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQWithOutKanbanOutPut", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -9583,10 +9794,10 @@ namespace Win.Sfs.SettleAccount.Migrations b.HasIndex("BillNum"); - b.ToTable("Set_WmsJitOutPut"); + b.ToTable("Set_WmsHQWithOutKanbanOutPut"); }); - modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPutDetial", b => + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQWithOutKanbanOutPutDetial", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -9603,10 +9814,6 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("BranchId") .HasColumnType("uniqueidentifier"); - b.Property("ChassisNumber") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(40) @@ -9632,21 +9839,15 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("Enabled") .HasColumnType("bit"); - b.Property("Extend1") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Extend2") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); + b.Property("Extend") + .HasColumnType("nvarchar(max)"); b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); - b.Property("InPut") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); + b.Property("IsBack") + .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -9654,10 +9855,6 @@ namespace Win.Sfs.SettleAccount.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); - b.Property("KennCode") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -9666,27 +9863,11 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.Property("MaterialCode") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - b.Property("MaterialDesc") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MaterialGroup") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("OutPut") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); + .HasColumnType("nvarchar(max)"); - b.Property("ParentMaterialCode") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); + b.Property("OutputQty") + .HasColumnType("decimal(18,2)"); b.Property("Price") .HasColumnType("decimal(18,2)"); @@ -9694,8 +9875,221 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("Qty") .HasColumnType("decimal(18,2)"); - b.Property("Remark") - .IsRequired() + b.Property("RealityNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SapMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsHQWithOutKanbanOutPutDetial"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPut", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsJitOutPut"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPutDetial", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChassisNumber") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend1") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Extend2") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KennCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialGroup") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("OutPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .IsRequired() .HasMaxLength(200) .HasColumnType("nvarchar(200)"); @@ -9925,6 +10319,210 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_WmsKanbanOutPutDetial"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsOneTimeSaleOutPut", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsOneTimeSaleOutPut"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsOneTimeSaleOutPutDetial", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsBack") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderBillNum") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OutPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OutputQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentMaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealityNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SapMaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WmsBillNum") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("BillNum"); + + b.ToTable("Set_WmsOneTimeSaleOutPutDetial"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPut", b => { b.Property("Id") diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs new file mode 100644 index 00000000..ba7262bc --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs @@ -0,0 +1,92 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + + public interface IUnHQSettleAppService + { + /// + /// 导入功能 + /// + /// 上传的文件(前端已经限制只能上传一个附件) + /// + + Task UnHQSettleUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, + string year, string period, string version, string customerCode); + + /// + /// 按ID获取唯一实体 + /// + /// + /// 返回实体全部属性 + /// + /// ID + /// 实体DTO + + Task GetAsync(Guid id); + + /// + /// 根据筛选条件获取实体列表 + /// + /// + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + /// + /// 请求条件 + /// 实体DTO列表 + + Task> GetListAsync(UnHQSettleRequestDto input); + + + + + /// + /// 根据筛选条件获取实体列表 + /// + /// + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + /// + /// 请求条件 + /// 实体DTO列表 + + Task> GetVersionListAsync(UnHQSettleVersionRequestDto input); + + + Task ExportAsync(UnHQSettleRequestDto input); + + /// + /// 获取实体总数 + /// + /// 实体总数 + + Task GetTotalCountAsync(Guid branchId); + + + + + + ///// + ///// 删除实体 + ///// + ///// ID + ///// + + Task DeleteAsync(Guid id); + + + /// + /// 按IDs删除实体列表 + /// + /// IDs + /// 是否执行成功 + + Task DeleteListAsync(List ids); + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs new file mode 100644 index 00000000..b9e5f6e8 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + public class UnHQSettleCreateDto : UnHQSettleDtoBase, IBranch + { + public virtual Guid BranchId { get; set; } + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs new file mode 100644 index 00000000..484b4899 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared.DtoBase; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + public class UnHQSettleDto : AuditedEntityDtoBase + { + /// + ///工厂 + /// + public string Factory { get; set; } + /// + ///外部看板编号 + /// + public string ExternalKanbanNumber { get; set; } + /// + ///看板编号 + /// + public string KanbanNumber { get; set; } + /// + ///物料凭证号 + /// + public string MaterialVoucherNo { get; set; } + + /// + ///会计年度 + /// + public string Year { get; set; } + /// + /// 期间 + /// + public string Period { set; get; } + /// + /// 版本号 + /// + public string Version { set; get; } + /// + /// 看板号 + /// + public string HQHKanBan { set; get; } + + + /// + /// 物料号 + /// + public string MaterialCode { get; set; } + + /// + /// 验收单日期 + /// + public DateTime AcceptanceDate { get; set; } + + /// + /// 供应商 + /// + public string Supplier { get; set; } + + /// + /// 存储地点 + /// + public string StorageLocation { get; set; } + + /// + /// 存储地点描述 + /// + public string StorageLocationDesc { get; set; } + + /// + ///验收单号 + /// + public string AcceptanceNo { get; set; } + + /// + /// 数量 + /// + public decimal Qty { set; get; } + + /// + /// 单价 + /// + public decimal Price { set; get; } + + /// + /// 金额 + /// + public decimal Amt { set; get; } + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs new file mode 100644 index 00000000..c5584c57 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared.DtoBase; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + public class UnHQSettleDtoBase : CreateOrUpdateEntityDtoBase + { + /// + ///工厂 + /// + public string Factory { get; set; } + /// + ///外部看板编号 + /// + public string ExternalKanbanNumber { get; set; } + /// + ///看板编号 + /// + public string KanbanNumber { get; set; } + /// + ///物料凭证号 + /// + public string MaterialVoucherNo { get; set; } + + /// + ///会计年度 + /// + public string Year { get; set; } + /// + /// 期间 + /// + public string Period { set; get; } + /// + /// 版本号 + /// + public string Version { set; get; } + /// + /// 类型:CP7报废和索赔两种 + /// + public string HQHKanBan { set; get; } + + + /// + /// 物料号 + /// + public string MaterialCode { get; set; } + + /// + /// 验收单日期 + /// + public DateTime AcceptanceDate { get; set; } + + /// + /// 供应商 + /// + public string Supplier { get; set; } + + /// + /// 存储地点描述 + /// + public string StorageLocation { get; set; } + + /// + /// 存储地点描述 + /// + public string StorageLocationDesc { get; set; } + + /// + ///验收单号 + /// + public string AcceptanceNo { get; set; } + + /// + /// 数量 + /// + public decimal Qty { set; get; } + + /// + /// 单价 + /// + public decimal Price { set; get; } + + /// + /// 金额 + /// + public decimal Amt { set; get; } + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs new file mode 100644 index 00000000..18ef6b80 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs @@ -0,0 +1,109 @@ +using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + public class UnHQSettleExportDto + { + /// + ///工厂 + /// + [ExporterHeader(DisplayName = "工厂")] + public string Factory { get; set; } + /// + ///外部看板编号 + /// + [ExporterHeader(DisplayName = "外部看板编号")] + public string ExternalKanbanNumber { get; set; } + /// + ///看板编号 + /// + [ExporterHeader(DisplayName = "看板编号")] + public string KanbanNumber { get; set; } + /// + ///物料凭证号 + /// + [ExporterHeader(DisplayName = "物料凭证号")] + public string MaterialVoucherNo { get; set; } + + /// + ///会计年度 + /// + [ExporterHeader(DisplayName = "会计年度")] + public string Year { get; set; } + /// + /// 期间 + /// + [ExporterHeader(DisplayName = "期间")] + public string Period { set; get; } + /// + /// 版本号 + /// + [ExporterHeader(DisplayName = "版本号")] + public string Version { set; get; } + /// + /// 看板号 + /// + [ExporterHeader(DisplayName = "看板号")] + public string HQHKanBan { set; get; } + + + /// + /// 物料号 + /// + [ExporterHeader(DisplayName = "物料号")] + public string MaterialCode { get; set; } + + /// + /// 验收单日期 + /// + [ExporterHeader(DisplayName = "验收单日期")] + public DateTime AcceptanceDate { get; set; } + + /// + /// 供应商 + /// + [ExporterHeader(DisplayName = "供应商")] + public string Supplier { get; set; } + + /// + /// 存储地点 + /// + [ExporterHeader(DisplayName = "存储地点")] + public string StorageLocation { get; set; } + + /// + /// 存储地点描述 + /// + [ExporterHeader(DisplayName = "存储地点描述")] + public string StorageLocationDesc { get; set; } + + /// + ///验收单号 + /// + [ExporterHeader(DisplayName = "验收单号")] + public string AcceptanceNo { get; set; } + + /// + /// 数量 + /// + [ExporterHeader(DisplayName = "数量")] + public decimal Qty { set; get; } + + /// + /// 单价 + /// + [ExporterHeader(DisplayName = "单价")] + public decimal Price { set; get; } + + /// + /// 金额 + /// + [ExporterHeader(DisplayName = "金额")] + public decimal Amt { set; get; } + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs new file mode 100644 index 00000000..1a4fff9b --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs @@ -0,0 +1,109 @@ +using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + public class UnHQSettleImportDto + { + /// + ///工厂 + /// + [ImporterHeader(Name = "工厂")] + public string Factory { get; set; } + /// + ///外部看板编号 + /// + [ImporterHeader(Name = "外部看板编号")] + public string ExternalKanbanNumber { get; set; } + /// + ///看板编号 + /// + [ImporterHeader(Name = "看板编号")] + public string KanbanNumber { get; set; } + /// + ///物料凭证号 + /// + [ImporterHeader(Name = "物料凭证号")] + public string MaterialVoucherNo { get; set; } + + /// + ///会计年度 + /// + [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 HQHKanBan { set; get; } + + + /// + /// 物料号 + /// + [ImporterHeader(Name = "物料号")] + public string MaterialCode { get; set; } + + /// + /// 验收单日期 + /// + [ImporterHeader(Name = "验收单日期")] + public DateTime AcceptanceDate { get; set; } + + /// + /// 供应商 + /// + [ImporterHeader(Name = "供应商")] + public string Supplier { get; set; } + + /// + /// 存储地点 + /// + [ImporterHeader(Name = "存储地点")] + public string StorageLocation { get; set; } + + /// + /// 存储地点描述 + /// + [ImporterHeader(Name = "存储地点描述")] + public string StorageLocationDesc { get; set; } + + /// + ///验收单号 + /// + [ImporterHeader(Name = "验收单号")] + public string AcceptanceNo { get; set; } + + /// + /// 数量 + /// + [ImporterHeader(Name = "数量")] + public decimal Qty { set; get; } + + /// + /// 单价 + /// + [ImporterHeader(Name = "单价")] + public decimal Price { set; get; } + + /// + /// 金额 + /// + [ImporterHeader(Name = "金额")] + public decimal Amt { set; get; } + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs new file mode 100644 index 00000000..9efa6f6e --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared.DtoBase; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + public class UnHQSettleRequestDto : RequestDtoBase + { + + /// + ///工厂 + /// + public string Factory { get; set; } + /// + ///外部看板编号 + /// + public string ExternalKanbanNumber { get; set; } + /// + ///看板编号 + /// + public string KanbanNumber { get; set; } + /// + ///物料凭证号 + /// + public string MaterialVoucherNo { get; set; } + + /// + ///会计年度 + /// + public string Year { get; set; } + /// + /// 期间 + /// + public string Period { set; get; } + /// + /// 版本号 + /// + public string Version { set; get; } + /// + /// 看板号 + /// + public string HQHKanBan { set; get; } + + + /// + /// 物料号 + /// + public string MaterialCode { get; set; } + + /// + /// 验收单日期 + /// + public DateTime AcceptanceDate { get; set; } + + /// + /// 供应商 + /// + public string Supplier { get; set; } + + /// + /// 存储地点 + /// + public string StorageLocation { get; set; } + + /// + ///验收单号 + /// + public string AcceptanceNo { get; set; } + + /// + /// 数量 + /// + public decimal Qty { set; get; } + + /// + /// 单价 + /// + public decimal Price { set; get; } + + /// + /// 金额 + /// + public decimal Amt { set; get; } + + /// + /// 存储地点描述 + /// + public string StorageLocationDesc { get; set; } + + public virtual Guid ParentId { get; set; } + public virtual Guid BranchId { get; set; } + + public virtual Guid UserId { get; set; } + + public virtual int FileType { get; set; } + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs new file mode 100644 index 00000000..1cba8b01 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared; +using Win.Sfs.Shared.DtoBase; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + /// + /// SettleAccountVersion + /// + public class UnHQSettleVersionDtoBase : CreateOrUpdateEntityDtoBase + { + + public string Year { get; private set; } + /// + /// 期间 + /// + public string Period { get; private set; } + /// + /// 版本号 + /// + public string Version { get; private set; } + + /// + /// 客户号 + /// + public string CustomerCode { private set; get; } + + + } + + + + public class UnHQSettleVersionDto : AuditedEntityDtoBase, IBranch + { + public string Year { get; set; } + /// + /// 期间 + /// + public string Period { get; set; } + /// + /// 版本号 + /// + public string Version { get; set; } + + /// + /// 客户号 + /// + public string CustomerCode { set; get; } + public Guid BranchId { get; set; } + } + + public class UnHQSettleVersionCreateDto : UnHQSettleVersionDtoBase + { } + public class UnHQSettleVersionUpdateDto : UnHQSettleVersionDtoBase + { } + public class UnHQSettleVersionRequestDto : RequestDtoBase, IBranch + { + + public string Year { get; private set; } + /// + /// 期间 + /// + public string Period { get; private set; } + /// + /// 版本号 + /// + public string Version { get; private set; } + + /// + /// 客户号 + /// + public string CustomerCode { private set; get; } + public Guid BranchId { get; set; } + } + + public class UnHQSettleVersionImportDto + { + + public string Year { get; private set; } + /// + /// 期间 + /// + public string Period { get; private set; } + /// + /// 版本号 + /// + public string Version { get; private set; } + + /// + /// 客户号 + /// + public string CustomerCode { private set; get; } + + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs new file mode 100644 index 00000000..7944e303 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs @@ -0,0 +1,332 @@ +using EFCore.BulkExtensions; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Csv; +using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Shouldly; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Caching; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Guids; +using Win.Abp.Snowflakes; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.CommonManagers; +using Win.Sfs.SettleAccount.Constant; +using Win.Sfs.SettleAccount.ExcelImporter; +using Win.Sfs.Shared.Filter; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + + /// + /// 红旗主机场明细导入 + /// + //[Authorize(SettleAccountPermissions.HQ_HPlatform.Default)] + //[AllowAnonymous] + [Route("api/settleaccount/UnHQSettle")] + public class UnHQSettleAppService : SettleAccountApplicationBase, IUnHQSettleAppService + { + private readonly IGuidGenerator _guidGenerator; + + private readonly IExcelImportAppService _excelImportService; + + private readonly ISettleAccountBranchEfCoreRepository _versionRepository; + + private readonly ISettleAccountBranchEfCoreRepository _repository; + + + private readonly ISettleAccountBranchEfCoreRepository _versionMRepository; + + private readonly ISettleAccountBranchEfCoreRepository _repositoryM; + /// + /// 构建方法 + /// + /// 构建UID + /// 仓储接口 + /// 缓存 + public UnHQSettleAppService(IGuidGenerator guidGenerator, + ISettleAccountBranchEfCoreRepository versionRepository, + ISettleAccountBranchEfCoreRepository repository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + ISettleAccountBranchEfCoreRepository versionMRepository + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _versionRepository = versionRepository; + _guidGenerator = guidGenerator; + _excelImportService = excelImportService; + _repository = repository; + _versionMRepository = versionMRepository; + } + + /// + /// 统一导入红旗主机场数据 + /// + /// + /// + /// + /// + /// + /// + /// + [HttpPost] + [Route("ExcelImport")] + [DisableRequestSizeLimit] + //[Authorize(SettleAccountPermissions.HQ_HPlatform.Create)] + public async Task UnHQSettleUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode) + { + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + + if (result == null || result.Count == 0) + { + throw new BusinessException("导入模板数据不能为空!"); + } + + var entityList = ObjectMapper.Map, List>(result); + //删除版本 + var _versionQuery = _versionRepository.Where(p => p.Version == version); + await _versionQuery.BatchDeleteAsync(); + //删除明细 + var _query = _repository.Where(p => p.Version == version); + await _query.BatchDeleteAsync(); + + var _id = GuidGenerator.Create(); + var _bomList = new List(); + _bomList.Add(new UnHQSettleAccountVersion(_id, branchId, year, period, version, customerCode)); + foreach (var itm in entityList) + { + if (string.IsNullOrEmpty(itm.HQHKanBan) && itm.StorageLocationDesc.Contains("备品")) + { + //赋值上主键ID + itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, "BJ");//备品库没有看板号,需要特殊标识一下BJ,已经和客户确认 + } + else + { + itm.SetValue(GuidGenerator.Create(), branchId, year, period, version); + } + } + + await _repository.GetDbContext().BulkInsertAsync(entityList); + await _versionRepository.GetDbContext().BulkInsertAsync(_bomList); + + return ApplicationConsts.SuccessStr; + } + + + + /// + /// 按ID获取唯一实体 + /// + /// + /// 返回实体全部属性 + /// + /// ID + /// 实体DTO + [HttpGet] + [Route("{id}")] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task GetAsync(Guid id) + { + var result = await GetFromCacheAsync(id); + var dto = ObjectMapper.Map(result); + return dto; + } + + + private async Task GetFromCacheAsync(Guid id) + { + var result = await _repository.GetAsync(id); + return result; + } + + + private async Task GetCountAsync(UnHQSettleRequestDto input) + { + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + } + + private async Task GetCountAsync(UnHQSettleVersionRequestDto input) + { + return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); + } + + + /// + /// 导出文件 + /// + /// + /// + [HttpPost] + [Route("Export")] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task ExportAsync(UnHQSettleRequestDto input) + { + + IExporter _csv = new CsvExporter(); + IExporter _excel = new ExcelExporter(); + if (!string.IsNullOrEmpty(input.Version)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); + } + var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, + 0, true); + + var dtoDetails = ObjectMapper.Map, List>(entities); + + string _fileName = string.Empty; + //声明导出容器 + + byte[] result = null; + switch (input.FileType) + { + case 0: + _fileName = string.Format("红旗未结明细_{0}.csv", input.UserId.ToString()); + result = await _csv.ExportAsByteArray(dtoDetails); + break; + case 1: + _fileName = string.Format("红旗未结明细_{0}.xlsx", input.UserId.ToString()); + result = await _excel.ExportAsByteArray(dtoDetails); + break; + } + result.ShouldNotBeNull(); + + //保存导出文件到服务器存成二进制 + await _excelImportService.SaveBlobAsync( + new SaveExcelImportInputDto + { + Name = _fileName, + Content = result + } + ); + return _fileName; + } + + + /// + /// 根据筛选条件获取实体列表 + /// + /// + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + /// + /// 请求条件 + /// 实体DTO列表 + [HttpPost] + [Route("list")] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task> GetListAsync(UnHQSettleRequestDto input) + { + if (!string.IsNullOrEmpty(input.Version)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); + } + else + { + return new PagedResultDto(0, new List()); + } + var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, + input.SkipCount, true); + + var totalCount = await GetCountAsync(input); + var dtos = ObjectMapper.Map, List>(entities); + + return new PagedResultDto(totalCount, dtos); + } + + + /// + /// 获取实体总数 + /// + /// 实体总数 + [HttpGet] + [Route("count")] + [Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task GetTotalCountAsync(Guid branchId) + { + return await _repository.GetCountAsync(branchId); + } + + /// + /// 获取全部实体列表 + /// + /// 实体DTO列表 + [HttpGet] + [Route("all")] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task> GetAllAsync(Guid branchId) + { + var entities = await _repository.GetAllAsync(branchId, true); + + + var dtos = ObjectMapper.Map, List>(entities); + + + return new ListResultDto(dtos); + } + + + + /// + /// 删除实体 + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + /// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)] + virtual public async Task DeleteAsync(Guid id) + { + await _repository.DeleteAsync(id); + } + + /// + /// 按IDs删除实体列表 + /// + /// IDs + /// 是否执行成功 + [HttpPost] + [Route("delete")] + // [Authorize(SettleAccountPermissions.SettleAccounts.Delete)] + virtual public async Task DeleteListAsync(List ids) + { + foreach (var id in ids) + { + var entity = await GetFromCacheAsync(id); + //await Cache.DeleteAsync(id.ToString()); + } + + return await _repository.DeleteListAsync(ids); + } + + + + /// + /// 版本列表查询 + /// + /// + /// + [HttpPost] + [Route("listversion")] + public async Task> GetVersionListAsync(UnHQSettleVersionRequestDto input) + { + var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, + input.SkipCount, true); + + var totalCount = await GetCountAsync(input); + var dtos = ObjectMapper.Map, List>(entities); + + return new PagedResultDto(totalCount, dtos); + } + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 7a621a0d..533dc56c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -2527,6 +2527,91 @@ 生成任务后回调函数 + + + 红旗主机场明细导入 + + + + + 构建方法 + + 构建UID + 仓储接口 + 缓存 + + + + 统一导入红旗主机场数据 + + + + + + + + + + + + 按ID获取唯一实体 + + + 返回实体全部属性 + + ID + 实体DTO + + + + 导出文件 + + + + + + + 根据筛选条件获取实体列表 + + + 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + + 请求条件 + 实体DTO列表 + + + + 获取实体总数 + + 实体总数 + + + + 获取全部实体列表 + + 实体DTO列表 + + + + 删除实体 + + ID + + + + + 按IDs删除实体列表 + + IDs + 是否执行成功 + + + + 版本列表查询 + + + + 大众看板结算明细导入 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 5d0b9edc..00983409 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -89,6 +89,7 @@ using Win.Sfs.SettleAccount.Entities.HQ_F; using Win.Sfs.SettleAccount.Entities.BT_Car; using Win.Sfs.SettleAccount.Entities.WMS; using Win.Sfs.SettleAccount.Entities; +using Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts; namespace Win.Sfs.SettleAccount { @@ -235,6 +236,10 @@ namespace Win.Sfs.SettleAccount CreateMapHQ_H_Platform(); CreateMapHQ_H_PlatformVersion(); + //红旗未结明细 + CreateMapUnHQSettleAccount(); + CreateMapUnHQSettleAccountVersion(); + //红旗M平台 CreateMapHQ_M_Platform(); CreateMapHQ_M_PlatformVersion(); @@ -417,6 +422,33 @@ namespace Win.Sfs.SettleAccount CreateMap (); } + + /// + /// 红旗明细未结导入 + /// + private void CreateMapUnHQSettleAccount() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + /// + /// 红旗明细未结-版本 + /// + private void CreateMapUnHQSettleAccountVersion() + + { + CreateMap().ReverseMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } + /// /// 大众备件发货 /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs new file mode 100644 index 00000000..1956dc44 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared.DomainBase; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + /// + /// 红旗主机场-未结明细 + /// + public class UnHQSettleAccount : FullAuditedAggregateRootBase, ISettleAccountEntityBase + { + public UnHQSettleAccount() + { } + + public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, string kanban) + { + Period = peroid; + Year = year; + Id = guid; + Version = version; + BranchId = branchId; + HQHKanBan = kanban; + } + + public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version) + { + Period = peroid; + Year = year; + Id = guid; + Version = version; + BranchId = branchId; + } + public UnHQSettleAccount(Guid Id, string materialVoucherNo, string externalKanbanNumber, + string kanbanNumber, string year, string factory, DateTime acceptanceDate, + string period, string version, string kanBan, string supplier, string storageLocation, string storageLocationDesc, + string materialCode, string acceptanceNo, decimal qty, decimal price, decimal amt) : base(Id) + { + MaterialVoucherNo = materialVoucherNo; + KanbanNumber = kanbanNumber; + ExternalKanbanNumber = externalKanbanNumber; + Year = year; + Factory = factory; + AcceptanceDate = acceptanceDate; + Period = period; + Version = version; + MaterialCode = materialCode; + HQHKanBan = kanBan; + Supplier = supplier; + StorageLocation = storageLocation; + StorageLocationDesc = storageLocationDesc; + AcceptanceNo = acceptanceNo; + Qty = qty; + Price = price; + Amt = amt; + } + + + //验收单号 外部单号 物料凭证号 物料凭证日期 物料凭证记账日期 看板编号 外部看板编号 物料号 物料描述 数量 单价 金额 + //工厂 备注 创建者 创建时间 修改人 修改时间 公司 验收单号 外部单号 发票号 会计年度 金额 计划员 存储地点 + //存储地点描述 状态 验收单日期 供应商 录入人 录入人描述 看板号 + + + + /// + ///工厂 + /// + [Display(Name = "工厂")] + public string Factory { get; set; } + /// + ///外部看板编号 + /// + [Display(Name = "外部看板编号")] + public string ExternalKanbanNumber { get; set; } + /// + ///看板编号 + /// + [Display(Name = "看板编号")] + public string KanbanNumber { get; set; } + /// + ///物料凭证号 + /// + [Display(Name = "物料凭证号")] + public string MaterialVoucherNo { get; set; } + + /// + ///会计年度 + /// + [Display(Name = "会计年度")] + public string Year { get; set; } + /// + /// 期间 + /// + [Display(Name = "期间")] + public string Period { set; get; } + /// + /// 版本号 + /// + [Display(Name = "版本号")] + public string Version { set; get; } + /// + /// 看板号 + /// + [Display(Name = "看板号")] + public string HQHKanBan { set; get; } + + + /// + /// 物料号 + /// + [Display(Name = "物料号")] + public string MaterialCode { get; set; } + + /// + /// 验收单日期 + /// + [Display(Name = "验收单日期")] + public DateTime AcceptanceDate { get; set; } + + /// + /// 供应商 + /// + [Display(Name = "供应商")] + public string Supplier { get; set; } + + /// + /// 存储地点 + /// + [Display(Name = "存储地点")] + public string StorageLocation { get; set; } + + /// + /// 存储地点描述 + /// + [Display(Name = "存储地点描述")] + public string StorageLocationDesc { get; set; } + + /// + ///验收单号 + /// + [Display(Name = "验收单号")] + public string AcceptanceNo { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + public decimal Qty { set; get; } + + /// + /// 单价 + /// + [Display(Name = "单价")] + public decimal Price { set; get; } + + /// + /// 金额 + /// + [Display(Name = "金额")] + public decimal Amt { set; get; } + + + /// + /// 备注 + /// + [Display(Name = "备注")] + public string Extend { set; get; } + + + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs new file mode 100644 index 00000000..ec17ed97 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Win.Sfs.Shared.DomainBase; + +namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts +{ + + public class UnHQSettleAccountVersion : FullAuditedAggregateRootBase, ISettleAccountEntityBase + { + + public UnHQSettleAccountVersion() + { } + + public string Year { get; private set; } + /// + /// 期间 + /// + public string Period { get; private set; } + /// + /// 版本号 + /// + public string Version { get; set; } + + /// + /// 客户号 + /// + public string CustomerCode { private set; get; } + + + public UnHQSettleAccountVersion( + Guid id, + Guid branchId, + string year, string period, string version, string customerCode) : base(id) + { + BranchId = branchId; + Year = year; + Period = period; + Version = version; + CustomerCode = customerCode; + + } + + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index ff835f4b..bf36fd3d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -72,7 +72,7 @@ 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; - +using Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts; namespace Win.Sfs.SettleAccount { @@ -312,6 +312,11 @@ namespace Win.Sfs.SettleAccount builder.ConfigureHQH(options); builder.ConfigureHQHVersion(options); + //红旗主机场-未结明细-导入 + builder.ConfigureUnHQSettleAccount(options); + builder.ConfigureUnHQSettleAccountVersion(options); + + //红旗F平台 builder.ConfigureHQF(options); builder.ConfigureHQFVersion(options); @@ -866,6 +871,68 @@ namespace Win.Sfs.SettleAccount } + + /// + /// 红旗主机场-未结明细-导入 + /// + /// + /// + private static void ConfigureUnHQSettleAccount(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + + b.ToTable($"{options.TablePrefix}_UnHQSettleAccount", options.Schema); + + b.ConfigureByConvention(); + //b.Property(x => x.HQHKanBan).IsRequired().HasMaxLength(150);//必填项 + b.Property(x => x.HQHKanBan).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.Property(x => x.AcceptanceNo).HasMaxLength(50); + + //创建组合索引 + //b.HasIndex(x => new { x.Version, x.HQHKanBan, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); + + }); + } + + /// + /// 红旗主机场-未结明细-版本 + /// + /// + /// + private static void ConfigureUnHQSettleAccountVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + b.ToTable($"{options.TablePrefix}_UnHQSettleAccountVersion", 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); + }); + + } + + + + + + /// /// 大众备件发货 ///