Administrator 3 years ago
parent
commit
833fcdd683
  1. 682
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs
  2. 92
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs
  3. 14
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs
  4. 92
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs
  5. 92
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs
  6. 109
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs
  7. 109
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs
  8. 101
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs
  9. 100
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs
  10. 332
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs
  11. 85
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  12. 32
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  13. 175
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs
  14. 48
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs
  15. 69
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

682
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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("AcceptanceDate")
.HasColumnType("datetime2");
b.Property<string>("AcceptanceNo")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExternalKanbanNumber")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("Factory")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("HQHKanBan")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("KanbanNumber")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("MaterialVoucherNo")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("Period")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("StorageLocation")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("StorageLocationDesc")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("Supplier")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Version")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Year")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.ToTable("Set_UnHQSettleAccount");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAccountVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Period")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("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<Guid>("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<Guid>("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<Guid>("Id")
.ValueGeneratedOnAdd()
@ -9603,10 +9814,6 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ChassisNumber")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
@ -9632,21 +9839,15 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend1")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend2")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("IsBack")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
@ -9654,10 +9855,6 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("KennCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
@ -9666,27 +9863,11 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialDesc")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("MaterialGroup")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
.HasColumnType("nvarchar(max)");
b.Property<string>("ParentMaterialCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("OutputQty")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
@ -9694,8 +9875,221 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.IsRequired()
b.Property<decimal>("RealityNumber")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SapMaterialCode")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("SockQty")
.HasColumnType("decimal(18,2)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<string>("Type")
.HasColumnType("nvarchar(max)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Creator")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ChassisNumber")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend1")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend2")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("KennCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialDesc")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("MaterialGroup")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ParentMaterialCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Creator")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("IsBack")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderBillNum")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("OutputQty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ParentMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("RealityNumber")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SapMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("SockQty")
.HasColumnType("decimal(18,2)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<string>("Type")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("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<Guid>("Id")

92
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
{
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
Task<string> UnHQSettleUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId,
string year, string period, string version, string customerCode);
/// <summary>
/// 按ID获取唯一实体
/// </summary>
/// <remarks>
/// 返回实体全部属性
/// </remarks>
/// <param name="id">ID</param>
/// <returns>实体DTO</returns>
Task<UnHQSettleDto> GetAsync(Guid id);
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
Task<PagedResultDto<UnHQSettleDto>> GetListAsync(UnHQSettleRequestDto input);
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
Task<PagedResultDto<UnHQSettleVersionDto>> GetVersionListAsync(UnHQSettleVersionRequestDto input);
Task<string> ExportAsync(UnHQSettleRequestDto input);
/// <summary>
/// 获取实体总数
/// </summary>
/// <returns>实体总数</returns>
Task<long> GetTotalCountAsync(Guid branchId);
///// <summary>
///// 删除实体
///// </summary>
///// <param name="id">ID</param>
///// <returns>无</returns>
Task DeleteAsync(Guid id);
/// <summary>
/// 按IDs删除实体列表
/// </summary>
/// <param name="ids">IDs</param>
/// <returns>是否执行成功</returns>
Task<bool> DeleteListAsync(List<Guid> ids);
}
}

14
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<Guid>
{
public virtual Guid BranchId { get; set; }
}
}

92
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<Guid>
{
/// <summary>
///工厂
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编号
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
/// </summary>
public string KanbanNumber { get; set; }
/// <summary>
///物料凭证号
/// </summary>
public string MaterialVoucherNo { get; set; }
/// <summary>
///会计年度
/// </summary>
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
public string Version { set; get; }
/// <summary>
/// 看板号
/// </summary>
public string HQHKanBan { set; get; }
/// <summary>
/// 物料号
/// </summary>
public string MaterialCode { get; set; }
/// <summary>
/// 验收单日期
/// </summary>
public DateTime AcceptanceDate { get; set; }
/// <summary>
/// 供应商
/// </summary>
public string Supplier { get; set; }
/// <summary>
/// 存储地点
/// </summary>
public string StorageLocation { get; set; }
/// <summary>
/// 存储地点描述
/// </summary>
public string StorageLocationDesc { get; set; }
/// <summary>
///验收单号
/// </summary>
public string AcceptanceNo { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { set; get; }
/// <summary>
/// 单价
/// </summary>
public decimal Price { set; get; }
/// <summary>
/// 金额
/// </summary>
public decimal Amt { set; get; }
}
}

92
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<Guid>
{
/// <summary>
///工厂
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编号
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
/// </summary>
public string KanbanNumber { get; set; }
/// <summary>
///物料凭证号
/// </summary>
public string MaterialVoucherNo { get; set; }
/// <summary>
///会计年度
/// </summary>
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
public string Version { set; get; }
/// <summary>
/// 类型:CP7报废和索赔两种
/// </summary>
public string HQHKanBan { set; get; }
/// <summary>
/// 物料号
/// </summary>
public string MaterialCode { get; set; }
/// <summary>
/// 验收单日期
/// </summary>
public DateTime AcceptanceDate { get; set; }
/// <summary>
/// 供应商
/// </summary>
public string Supplier { get; set; }
/// <summary>
/// 存储地点描述
/// </summary>
public string StorageLocation { get; set; }
/// <summary>
/// 存储地点描述
/// </summary>
public string StorageLocationDesc { get; set; }
/// <summary>
///验收单号
/// </summary>
public string AcceptanceNo { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { set; get; }
/// <summary>
/// 单价
/// </summary>
public decimal Price { set; get; }
/// <summary>
/// 金额
/// </summary>
public decimal Amt { set; get; }
}
}

109
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
{
/// <summary>
///工厂
/// </summary>
[ExporterHeader(DisplayName = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编号
/// </summary>
[ExporterHeader(DisplayName = "外部看板编号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
/// </summary>
[ExporterHeader(DisplayName = "看板编号")]
public string KanbanNumber { get; set; }
/// <summary>
///物料凭证号
/// </summary>
[ExporterHeader(DisplayName = "物料凭证号")]
public string MaterialVoucherNo { get; set; }
/// <summary>
///会计年度
/// </summary>
[ExporterHeader(DisplayName = "会计年度")]
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
[ExporterHeader(DisplayName = "版本号")]
public string Version { set; get; }
/// <summary>
/// 看板号
/// </summary>
[ExporterHeader(DisplayName = "看板号")]
public string HQHKanBan { set; get; }
/// <summary>
/// 物料号
/// </summary>
[ExporterHeader(DisplayName = "物料号")]
public string MaterialCode { get; set; }
/// <summary>
/// 验收单日期
/// </summary>
[ExporterHeader(DisplayName = "验收单日期")]
public DateTime AcceptanceDate { get; set; }
/// <summary>
/// 供应商
/// </summary>
[ExporterHeader(DisplayName = "供应商")]
public string Supplier { get; set; }
/// <summary>
/// 存储地点
/// </summary>
[ExporterHeader(DisplayName = "存储地点")]
public string StorageLocation { get; set; }
/// <summary>
/// 存储地点描述
/// </summary>
[ExporterHeader(DisplayName = "存储地点描述")]
public string StorageLocationDesc { get; set; }
/// <summary>
///验收单号
/// </summary>
[ExporterHeader(DisplayName = "验收单号")]
public string AcceptanceNo { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { set; get; }
/// <summary>
/// 单价
/// </summary>
[ExporterHeader(DisplayName = "单价")]
public decimal Price { set; get; }
/// <summary>
/// 金额
/// </summary>
[ExporterHeader(DisplayName = "金额")]
public decimal Amt { set; get; }
}
}

109
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
{
/// <summary>
///工厂
/// </summary>
[ImporterHeader(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编号
/// </summary>
[ImporterHeader(Name = "外部看板编号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
/// </summary>
[ImporterHeader(Name = "看板编号")]
public string KanbanNumber { get; set; }
/// <summary>
///物料凭证号
/// </summary>
[ImporterHeader(Name = "物料凭证号")]
public string MaterialVoucherNo { get; set; }
/// <summary>
///会计年度
/// </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 HQHKanBan { set; get; }
/// <summary>
/// 物料号
/// </summary>
[ImporterHeader(Name = "物料号")]
public string MaterialCode { get; set; }
/// <summary>
/// 验收单日期
/// </summary>
[ImporterHeader(Name = "验收单日期")]
public DateTime AcceptanceDate { get; set; }
/// <summary>
/// 供应商
/// </summary>
[ImporterHeader(Name = "供应商")]
public string Supplier { get; set; }
/// <summary>
/// 存储地点
/// </summary>
[ImporterHeader(Name = "存储地点")]
public string StorageLocation { get; set; }
/// <summary>
/// 存储地点描述
/// </summary>
[ImporterHeader(Name = "存储地点描述")]
public string StorageLocationDesc { get; set; }
/// <summary>
///验收单号
/// </summary>
[ImporterHeader(Name = "验收单号")]
public string AcceptanceNo { get; set; }
/// <summary>
/// 数量
/// </summary>
[ImporterHeader(Name = "数量")]
public decimal Qty { set; get; }
/// <summary>
/// 单价
/// </summary>
[ImporterHeader(Name = "单价")]
public decimal Price { set; get; }
/// <summary>
/// 金额
/// </summary>
[ImporterHeader(Name = "金额")]
public decimal Amt { set; get; }
}
}

101
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
{
/// <summary>
///工厂
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编号
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
/// </summary>
public string KanbanNumber { get; set; }
/// <summary>
///物料凭证号
/// </summary>
public string MaterialVoucherNo { get; set; }
/// <summary>
///会计年度
/// </summary>
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
public string Version { set; get; }
/// <summary>
/// 看板号
/// </summary>
public string HQHKanBan { set; get; }
/// <summary>
/// 物料号
/// </summary>
public string MaterialCode { get; set; }
/// <summary>
/// 验收单日期
/// </summary>
public DateTime AcceptanceDate { get; set; }
/// <summary>
/// 供应商
/// </summary>
public string Supplier { get; set; }
/// <summary>
/// 存储地点
/// </summary>
public string StorageLocation { get; set; }
/// <summary>
///验收单号
/// </summary>
public string AcceptanceNo { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { set; get; }
/// <summary>
/// 单价
/// </summary>
public decimal Price { set; get; }
/// <summary>
/// 金额
/// </summary>
public decimal Amt { set; get; }
/// <summary>
/// 存储地点描述
/// </summary>
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; }
}
}

100
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
{
/// <summary>
/// SettleAccountVersion
/// </summary>
public class UnHQSettleVersionDtoBase : CreateOrUpdateEntityDtoBase<Guid>
{
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; private set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { private set; get; }
}
public class UnHQSettleVersionDto : AuditedEntityDtoBase<Guid>, IBranch<Guid>
{
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { set; get; }
public Guid BranchId { get; set; }
}
public class UnHQSettleVersionCreateDto : UnHQSettleVersionDtoBase
{ }
public class UnHQSettleVersionUpdateDto : UnHQSettleVersionDtoBase
{ }
public class UnHQSettleVersionRequestDto : RequestDtoBase, IBranch<Guid>
{
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; private set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { private set; get; }
public Guid BranchId { get; set; }
}
public class UnHQSettleVersionImportDto
{
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; private set; }
/// <summary>
/// 客户号
/// </summary>
public string CustomerCode { private set; get; }
}
}

332
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
{
/// <summary>
/// 红旗主机场明细导入
/// </summary>
//[Authorize(SettleAccountPermissions.HQ_HPlatform.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/UnHQSettle")]
public class UnHQSettleAppService : SettleAccountApplicationBase<UnHQSettleAccount>, IUnHQSettleAppService
{
private readonly IGuidGenerator _guidGenerator;
private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository<UnHQSettleAccountVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<UnHQSettleAccount, Guid> _repository;
private readonly ISettleAccountBranchEfCoreRepository<UnHQSettleAccountVersion, Guid> _versionMRepository;
private readonly ISettleAccountBranchEfCoreRepository<UnHQSettleAccount, Guid> _repositoryM;
/// <summary>
/// 构建方法
/// </summary>
/// <param name="guidGenerator">构建UID</param>
/// <param name="repository">仓储接口</param>
/// <param name="cache">缓存</param>
public UnHQSettleAppService(IGuidGenerator guidGenerator,
ISettleAccountBranchEfCoreRepository<UnHQSettleAccountVersion, Guid> versionRepository,
ISettleAccountBranchEfCoreRepository<UnHQSettleAccount, Guid> repository,
IDistributedCache<UnHQSettleAccount> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
ISettleAccountBranchEfCoreRepository<UnHQSettleAccountVersion, Guid> versionMRepository
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_versionRepository = versionRepository;
_guidGenerator = guidGenerator;
_excelImportService = excelImportService;
_repository = repository;
_versionMRepository = versionMRepository;
}
/// <summary>
/// 统一导入红旗主机场数据
/// </summary>
/// <param name="files"></param>
/// <param name="branchId"></param>
/// <param name="year"></param>
/// <param name="period"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.HQ_HPlatform.Create)]
public async Task<string> UnHQSettleUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<UnHQSettleImportDto>(files, _excelImportService);
if (result == null || result.Count == 0)
{
throw new BusinessException("导入模板数据不能为空!");
}
var entityList = ObjectMapper.Map<List<UnHQSettleImportDto>, List<UnHQSettleAccount>>(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<UnHQSettleAccountVersion>();
_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<UnHQSettleAccount>(entityList);
await _versionRepository.GetDbContext().BulkInsertAsync(_bomList);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 按ID获取唯一实体
/// </summary>
/// <remarks>
/// 返回实体全部属性
/// </remarks>
/// <param name="id">ID</param>
/// <returns>实体DTO</returns>
[HttpGet]
[Route("{id}")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<UnHQSettleDto> GetAsync(Guid id)
{
var result = await GetFromCacheAsync(id);
var dto = ObjectMapper.Map<UnHQSettleAccount, UnHQSettleDto>(result);
return dto;
}
private async Task<UnHQSettleAccount> GetFromCacheAsync(Guid id)
{
var result = await _repository.GetAsync(id);
return result;
}
private async Task<long> GetCountAsync(UnHQSettleRequestDto input)
{
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
private async Task<long> GetCountAsync(UnHQSettleVersionRequestDto input)
{
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
/// <summary>
/// 导出文件
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> 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<UnHQSettleAccount>, List<UnHQSettleExportDto>>(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;
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<UnHQSettleDto>> 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<UnHQSettleDto>(0, new List<UnHQSettleDto>());
}
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<UnHQSettleAccount>, List<UnHQSettleDto>>(entities);
return new PagedResultDto<UnHQSettleDto>(totalCount, dtos);
}
/// <summary>
/// 获取实体总数
/// </summary>
/// <returns>实体总数</returns>
[HttpGet]
[Route("count")]
[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<long> GetTotalCountAsync(Guid branchId)
{
return await _repository.GetCountAsync(branchId);
}
/// <summary>
/// 获取全部实体列表
/// </summary>
/// <returns>实体DTO列表</returns>
[HttpGet]
[Route("all")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<ListResultDto<UnHQSettleDto>> GetAllAsync(Guid branchId)
{
var entities = await _repository.GetAllAsync(branchId, true);
var dtos = ObjectMapper.Map<List<UnHQSettleAccount>, List<UnHQSettleDto>>(entities);
return new ListResultDto<UnHQSettleDto>(dtos);
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">ID</param>
/// <returns>无</returns>
[HttpDelete]
[Route("{id}")]
/// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)]
virtual public async Task DeleteAsync(Guid id)
{
await _repository.DeleteAsync(id);
}
/// <summary>
/// 按IDs删除实体列表
/// </summary>
/// <param name="ids">IDs</param>
/// <returns>是否执行成功</returns>
[HttpPost]
[Route("delete")]
// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)]
virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{
foreach (var id in ids)
{
var entity = await GetFromCacheAsync(id);
//await Cache.DeleteAsync<SettleAccount>(id.ToString());
}
return await _repository.DeleteListAsync(ids);
}
/// <summary>
/// 版本列表查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("listversion")]
public async Task<PagedResultDto<UnHQSettleVersionDto>> 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<UnHQSettleAccountVersion>, List<UnHQSettleVersionDto>>(entities);
return new PagedResultDto<UnHQSettleVersionDto>(totalCount, dtos);
}
}
}

85
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -2527,6 +2527,91 @@
<param name="action">生成任务后回调函数</param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService">
<summary>
红旗主机场明细导入
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.#ctor(Volo.Abp.Guids.IGuidGenerator,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAccountVersion,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAccount,System.Guid},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAccount},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAccountVersion,System.Guid})">
<summary>
构建方法
</summary>
<param name="guidGenerator">构建UID</param>
<param name="repository">仓储接口</param>
<param name="cache">缓存</param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.UnHQSettleUploadExcelImport(Microsoft.AspNetCore.Http.IFormFileCollection,System.Guid,System.String,System.String,System.String,System.String)">
<summary>
统一导入红旗主机场数据
</summary>
<param name="files"></param>
<param name="branchId"></param>
<param name="year"></param>
<param name="period"></param>
<param name="version"></param>
<param name="customerCode"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.GetAsync(System.Guid)">
<summary>
按ID获取唯一实体
</summary>
<remarks>
返回实体全部属性
</remarks>
<param name="id">ID</param>
<returns>实体DTO</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.ExportAsync(Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleRequestDto)">
<summary>
导出文件
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleRequestDto)">
<summary>
根据筛选条件获取实体列表
</summary>
<remarks>
请求条件包括:筛选条件列表,排序条件,数据数量,页码
</remarks>
<param name="input">请求条件</param>
<returns>实体DTO列表</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.GetTotalCountAsync(System.Guid)">
<summary>
获取实体总数
</summary>
<returns>实体总数</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.GetAllAsync(System.Guid)">
<summary>
获取全部实体列表
</summary>
<returns>实体DTO列表</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.DeleteAsync(System.Guid)">
<summary>
删除实体
</summary>
<param name="id">ID</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.DeleteListAsync(System.Collections.Generic.List{System.Guid})">
<summary>
按IDs删除实体列表
</summary>
<param name="ids">IDs</param>
<returns>是否执行成功</returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleAppService.GetVersionListAsync(Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts.UnHQSettleVersionRequestDto)">
<summary>
版本列表查询
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.VWKanBan.VWKanBanAppService">
<summary>
大众看板结算明细导入

32
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 <HQ_H_PlatformVersionUpdateDto, HQ_H_PlatformVersion > ();
}
/// <summary>
/// 红旗明细未结导入
/// </summary>
private void CreateMapUnHQSettleAccount()
{
CreateMap<UnHQSettleAccount, UnHQSettleDto>().ReverseMap();
CreateMap<UnHQSettleAccount, UnHQSettleRequestDto>().ReverseMap();
CreateMap<UnHQSettleAccount, UnHQSettleImportDto>().ReverseMap();
CreateMap<UnHQSettleAccount, UnHQSettleExportDto>().ReverseMap();
CreateMap<UnHQSettleAccount, UnHQSettleExportDto>().ReverseMap();
}
/// <summary>
/// 红旗明细未结-版本
/// </summary>
private void CreateMapUnHQSettleAccountVersion()
{
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>();
}
/// <summary>
/// 大众备件发货
/// </summary>

175
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
{
/// <summary>
/// 红旗主机场-未结明细
/// </summary>
public class UnHQSettleAccount : FullAuditedAggregateRootBase<Guid>, 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;
}
//验收单号 外部单号 物料凭证号 物料凭证日期 物料凭证记账日期 看板编号 外部看板编号 物料号 物料描述 数量 单价 金额
//工厂 备注 创建者 创建时间 修改人 修改时间 公司 验收单号 外部单号 发票号 会计年度 金额 计划员 存储地点
//存储地点描述 状态 验收单日期 供应商 录入人 录入人描述 看板号
/// <summary>
///工厂
/// </summary>
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编号
/// </summary>
[Display(Name = "外部看板编号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
/// </summary>
[Display(Name = "看板编号")]
public string KanbanNumber { get; set; }
/// <summary>
///物料凭证号
/// </summary>
[Display(Name = "物料凭证号")]
public string MaterialVoucherNo { get; set; }
/// <summary>
///会计年度
/// </summary>
[Display(Name = "会计年度")]
public string Year { get; set; }
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public string Period { set; get; }
/// <summary>
/// 版本号
/// </summary>
[Display(Name = "版本号")]
public string Version { set; get; }
/// <summary>
/// 看板号
/// </summary>
[Display(Name = "看板号")]
public string HQHKanBan { set; get; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
public string MaterialCode { get; set; }
/// <summary>
/// 验收单日期
/// </summary>
[Display(Name = "验收单日期")]
public DateTime AcceptanceDate { get; set; }
/// <summary>
/// 供应商
/// </summary>
[Display(Name = "供应商")]
public string Supplier { get; set; }
/// <summary>
/// 存储地点
/// </summary>
[Display(Name = "存储地点")]
public string StorageLocation { get; set; }
/// <summary>
/// 存储地点描述
/// </summary>
[Display(Name = "存储地点描述")]
public string StorageLocationDesc { get; set; }
/// <summary>
///验收单号
/// </summary>
[Display(Name = "验收单号")]
public string AcceptanceNo { get; set; }
/// <summary>
/// 数量
/// </summary>
[Display(Name = "数量")]
public decimal Qty { set; get; }
/// <summary>
/// 单价
/// </summary>
[Display(Name = "单价")]
public decimal Price { set; get; }
/// <summary>
/// 金额
/// </summary>
[Display(Name = "金额")]
public decimal Amt { set; get; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
public string Extend { set; get; }
}
}

48
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<Guid>, ISettleAccountEntityBase
{
public UnHQSettleAccountVersion()
{ }
public string Year { get; private set; }
/// <summary>
/// 期间
/// </summary>
public string Period { get; private set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary>
/// 客户号
/// </summary>
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;
}
}
}

69
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
}
/// <summary>
/// 红旗主机场-未结明细-导入
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
private static void ConfigureUnHQSettleAccount(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<UnHQSettleAccount>(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);
});
}
/// <summary>
/// 红旗主机场-未结明细-版本
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
private static void ConfigureUnHQSettleAccountVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<UnHQSettleAccountVersion>(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);
});
}
/// <summary>
/// 大众备件发货
/// </summary>

Loading…
Cancel
Save