diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/HiddenApiAttribute.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/HiddenApiAttribute.cs new file mode 100644 index 0000000..f1a2774 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/HiddenApiAttribute.cs @@ -0,0 +1,8 @@ +using System; + +namespace Win_in.Sfs.Scp.WebApi; + +[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] +public class HiddenApiAttribute : System.Attribute +{ +} \ No newline at end of file diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/HiddenApiFilter.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/HiddenApiFilter.cs new file mode 100644 index 0000000..1c287a3 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/HiddenApiFilter.cs @@ -0,0 +1,35 @@ +using System.Linq; +using System.Reflection; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Win_in.Sfs.Scp.WebApi; + +/// +/// 自定义Swagger隐藏过滤器 +/// +public class HiddenApiFilter : IDocumentFilter +{ + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) + { + foreach (ApiDescription apiDescription in context.ApiDescriptions) + { + if (apiDescription.TryGetMethodInfo(out MethodInfo method)) + { + if (method.ReflectedType.CustomAttributes.Any(t => t.AttributeType == typeof(HiddenApiAttribute)) + || method.CustomAttributes.Any(t => t.AttributeType == typeof(HiddenApiAttribute))) + { + string key = "/" + apiDescription.RelativePath; + if (key.Contains("?")) + { + int idx = key.IndexOf("?", System.StringComparison.Ordinal); + key = key.Substring(0, idx); + } + swaggerDoc.Paths.Remove(key); + } + } + } + } + +} \ No newline at end of file diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.Designer.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.Designer.cs deleted file mode 100644 index ee82423..0000000 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.Designer.cs +++ /dev/null @@ -1,759 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Volo.Abp.EntityFrameworkCore; -using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; - -namespace Win_in.Sfs.Scp.WebApi.Migrations -{ - [DbContext(typeof(WebApiHttpApiHostMigrationsDbContext))] - [Migration("20211021072716_20211021001")] - partial class _20211021001 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.11") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("ContactName") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ContactPhone") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - 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("DueDate") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsConsignment") - .HasColumnType("bit"); - - 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("OrderDate") - .HasColumnType("datetime2"); - - b.Property("PoNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TaxRate") - .HasColumnType("decimal(18,2)"); - - b.Property("Version") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("PoNumber") - .IsUnique() - .HasFilter("IsDeleted=0"); - - b.ToTable("WebApi_PO"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("IsConsignment") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("LineStatus") - .HasColumnType("int"); - - b.Property("OrderQty") - .IsRequired() - .HasColumnType("decimal(18,2)"); - - b.Property("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoLine") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("StdPackQty") - .IsRequired() - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPackConvertRate") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackUom") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("PoNumber", "PoLine") - .IsUnique(); - - b.ToTable("WebApi_PODetail"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Part", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Color") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("Configuration") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - 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("Desc1") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("Desc2") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("Eco") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ExtPackUom") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("Group") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("IsBuyPart") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("IsMakePart") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Project") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("StdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Type") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("abcClass") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("catalog") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("productline") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("IsDeleted=0"); - - b.ToTable("WebApi_Part"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Receipt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AsnNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Lot") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - 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("DeliverQty") - .HasColumnType("decimal(18,2)"); - - 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("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoLine") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ProductionDate") - .HasColumnType("datetime2"); - - b.Property("RcNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("RcType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ReceiveQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ReceiveTime") - .HasColumnType("datetime2"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("RpNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("StdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierLot") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPackConvertRate") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TimeWindowEnd") - .HasColumnType("datetime2"); - - b.Property("TimeWindowBegin") - .HasColumnType("datetime2"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Warehouse") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Dock") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("RcNumber", "PoLine", "PartCode") - .IsUnique() - .HasFilter("IsDeleted=0"); - - b.ToTable("WebApi_Receipt"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Address") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("City") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("ContactName") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Country") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("Currency") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("Desc") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("Fax") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - 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("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Phone") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PostId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Rank") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("WebApi_Suppliers"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.SupplierPart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .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("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("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPartCode") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("SupplierStdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierStdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("SupplierCode", "PartCode") - .IsUnique() - .HasFilter("IsDeleted=0"); - - b.ToTable("WebApi_SupplierPart"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => - { - b.HasOne("Win_in.Sfs.Scp.WebApi.PO", null) - .WithMany("PODetails") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => - { - b.Navigation("PODetails"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.cs deleted file mode 100644 index 04fee76..0000000 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.cs +++ /dev/null @@ -1,291 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Win_in.Sfs.Scp.WebApi.Migrations -{ - public partial class _20211021001 : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "WebApi_Part", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Desc1 = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), - Desc2 = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), - Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - IsMakePart = table.Column(type: "bit", nullable: false), - IsBuyPart = table.Column(type: "bit", nullable: false), - Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - abcClass = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - productline = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Type = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - catalog = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Group = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Color = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Configuration = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Project = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Eco = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - StdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - StdPackQty = table.Column(type: "decimal(18,2)", nullable: false), - ExtPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - ExtPackQty = table.Column(type: "decimal(18,2)", nullable: false), - Site = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true), - SequenceNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Version = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WebApi_Part", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WebApi_PO", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - PoNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - SupplierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - PoType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Status = table.Column(type: "int", nullable: false), - IsConsignment = table.Column(type: "bit", nullable: false), - OrderDate = table.Column(type: "datetime2", nullable: false), - DueDate = table.Column(type: "datetime2", nullable: false), - Version = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - TaxRate = table.Column(type: "decimal(18,2)", nullable: false), - Site = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - ContactName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - ContactPhone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WebApi_PO", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WebApi_Receipt", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - RcNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - AsnNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - RpNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - PoNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - SupplierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - RcType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Warehouse = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Dock = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - TimeWindowBegin = table.Column(type: "datetime2", nullable: false), - TimeWindowEnd = table.Column(type: "datetime2", nullable: false), - ReceiveTime = table.Column(type: "datetime2", nullable: false), - Site = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - PoLine = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - PartCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Lot = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - SupplierLot = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - ProductionDate = table.Column(type: "datetime2", nullable: false), - Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - DeliverQty = table.Column(type: "decimal(18,2)", nullable: false), - ReceiveQty = table.Column(type: "decimal(18,2)", nullable: false), - StdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - StdPackQty = table.Column(type: "decimal(18,2)", nullable: false), - SupplierPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - SupplierPackQty = table.Column(type: "decimal(18,2)", nullable: false), - SupplierPackConvertRate = table.Column(type: "decimal(18,2)", nullable: false), - Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WebApi_Receipt", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WebApi_SupplierPart", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - SupplierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - PartCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - SupplierPartCode = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), - SupplierStdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - SupplierStdPackQty = table.Column(type: "decimal(18,2)", nullable: false), - Remark = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WebApi_SupplierPart", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WebApi_Suppliers", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Desc = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), - Rank = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Address = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), - Country = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - City = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Phone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Fax = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - PostId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - ContactName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Currency = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - IsActive = table.Column(type: "bit", nullable: false), - Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WebApi_Suppliers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WebApi_PODetail", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - PoNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - PoLine = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - PartCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - OrderQty = table.Column(type: "decimal(18,2)", nullable: false), - StdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - StdPackQty = table.Column(type: "decimal(18,2)", nullable: false), - SupplierPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - SupplierPackQty = table.Column(type: "decimal(18,2)", nullable: true), - SupplierPackConvertRate = table.Column(type: "decimal(18,2)", nullable: true), - IsConsignment = table.Column(type: "bit", nullable: false), - LineStatus = table.Column(type: "int", nullable: false), - Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WebApi_PODetail", x => x.Id); - table.ForeignKey( - name: "FK_WebApi_PODetail_WebApi_PO_Id", - column: x => x.Id, - principalTable: "WebApi_PO", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_Part_Code", - table: "WebApi_Part", - column: "Code", - unique: true, - filter: "IsDeleted=0"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_PO_PoNumber", - table: "WebApi_PO", - column: "PoNumber", - unique: true, - filter: "IsDeleted=0"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_PODetail_PoNumber_PoLine", - table: "WebApi_PODetail", - columns: new[] { "PoNumber", "PoLine" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", - table: "WebApi_Receipt", - columns: new[] { "RcNumber", "PoLine", "PartCode" }, - unique: true, - filter: "IsDeleted=0"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", - table: "WebApi_SupplierPart", - columns: new[] { "SupplierCode", "PartCode" }, - unique: true, - filter: "IsDeleted=0"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_Suppliers_CreationTime", - table: "WebApi_Suppliers", - column: "CreationTime"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WebApi_Part"); - - migrationBuilder.DropTable( - name: "WebApi_PODetail"); - - migrationBuilder.DropTable( - name: "WebApi_Receipt"); - - migrationBuilder.DropTable( - name: "WebApi_SupplierPart"); - - migrationBuilder.DropTable( - name: "WebApi_Suppliers"); - - migrationBuilder.DropTable( - name: "WebApi_PO"); - } - } -} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.Designer.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.Designer.cs deleted file mode 100644 index 680100b..0000000 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.Designer.cs +++ /dev/null @@ -1,728 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Volo.Abp.EntityFrameworkCore; -using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; - -namespace Win_in.Sfs.Scp.WebApi.Migrations -{ - [DbContext(typeof(WebApiHttpApiHostMigrationsDbContext))] - [Migration("20211021081413_20211021002")] - partial class _20211021002 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.11") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("ContactName") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ContactPhone") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DueDate") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsConsignment") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("OrderDate") - .HasColumnType("datetime2"); - - b.Property("PoNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TaxRate") - .HasColumnType("decimal(18,2)"); - - b.Property("Version") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("PoNumber") - .IsUnique() - .HasFilter("[PoNumber] IS NOT NULL"); - - b.ToTable("WebApi_PO"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => - { - b.Property("Id") - .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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsConsignment") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("LineStatus") - .HasColumnType("int"); - - b.Property("OrderQty") - .IsRequired() - .HasColumnType("decimal(18,2)"); - - b.Property("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoLine") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("StdPackQty") - .IsRequired() - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPackConvertRate") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackUom") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("PoNumber", "PoLine") - .IsUnique(); - - b.ToTable("WebApi_PODetail"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Part", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Color") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("Configuration") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("Desc1") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("Desc2") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("Eco") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ExtPackUom") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("Group") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("IsBuyPart") - .HasColumnType("bit"); - - b.Property("IsMakePart") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Project") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("StdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Type") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("abcClass") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("catalog") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("productline") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("WebApi_Part"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Receipt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AsnNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Lot") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - 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("DeliverQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoLine") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ProductionDate") - .HasColumnType("datetime2"); - - b.Property("RcNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("RcType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ReceiveQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ReceiveTime") - .HasColumnType("datetime2"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("RpNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("StdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierLot") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPackConvertRate") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TimeWindowEnd") - .HasColumnType("datetime2"); - - b.Property("TimeWindowBegin") - .HasColumnType("datetime2"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Warehouse") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Dock") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("RcNumber", "PoLine", "PartCode") - .IsUnique(); - - b.ToTable("WebApi_Receipt"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Address") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("City") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("ContactName") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Country") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("Currency") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Desc") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("Fax") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Phone") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PostId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Rank") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("WebApi_Suppliers"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.SupplierPart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPartCode") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("SupplierStdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierStdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("SupplierCode", "PartCode") - .IsUnique(); - - b.ToTable("WebApi_SupplierPart"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => - { - b.HasOne("Win_in.Sfs.Scp.WebApi.PO", null) - .WithMany("PODetails") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => - { - b.Navigation("PODetails"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.cs deleted file mode 100644 index b94785f..0000000 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.cs +++ /dev/null @@ -1,363 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Win_in.Sfs.Scp.WebApi.Migrations -{ - public partial class _20211021002 : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", - table: "WebApi_SupplierPart"); - - migrationBuilder.DropIndex( - name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", - table: "WebApi_Receipt"); - - migrationBuilder.DropIndex( - name: "IX_WebApi_PO_PoNumber", - table: "WebApi_PO"); - - migrationBuilder.DropIndex( - name: "IX_WebApi_Part_Code", - table: "WebApi_Part"); - - migrationBuilder.DropColumn( - name: "DeleterId", - table: "WebApi_Suppliers"); - - migrationBuilder.DropColumn( - name: "DeletionTime", - table: "WebApi_Suppliers"); - - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "WebApi_Suppliers"); - - migrationBuilder.DropColumn( - name: "DeleterId", - table: "WebApi_SupplierPart"); - - migrationBuilder.DropColumn( - name: "DeletionTime", - table: "WebApi_SupplierPart"); - - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "WebApi_SupplierPart"); - - migrationBuilder.DropColumn( - name: "DeleterId", - table: "WebApi_Receipt"); - - migrationBuilder.DropColumn( - name: "DeletionTime", - table: "WebApi_Receipt"); - - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "WebApi_Receipt"); - - migrationBuilder.DropColumn( - name: "DeleterId", - table: "WebApi_PO"); - - migrationBuilder.DropColumn( - name: "DeletionTime", - table: "WebApi_PO"); - - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "WebApi_PO"); - - migrationBuilder.DropColumn( - name: "DeleterId", - table: "WebApi_Part"); - - migrationBuilder.DropColumn( - name: "DeletionTime", - table: "WebApi_Part"); - - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "WebApi_Part"); - - migrationBuilder.AddColumn( - name: "SequenceNumber", - table: "WebApi_Suppliers", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.AddColumn( - name: "Version", - table: "WebApi_Suppliers", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.AddColumn( - name: "SequenceNumber", - table: "WebApi_SupplierPart", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.AddColumn( - name: "Version", - table: "WebApi_SupplierPart", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.AddColumn( - name: "SequenceNumber", - table: "WebApi_Receipt", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.AddColumn( - name: "Version", - table: "WebApi_Receipt", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.AddColumn( - name: "ConcurrencyStamp", - table: "WebApi_PODetail", - type: "nvarchar(40)", - maxLength: 40, - nullable: true); - - migrationBuilder.AddColumn( - name: "ExtraProperties", - table: "WebApi_PODetail", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "Version", - table: "WebApi_PODetail", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.AddColumn( - name: "SequenceNumber", - table: "WebApi_PO", - type: "nvarchar(64)", - maxLength: 64, - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", - table: "WebApi_SupplierPart", - columns: new[] { "SupplierCode", "PartCode" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", - table: "WebApi_Receipt", - columns: new[] { "RcNumber", "PoLine", "PartCode" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_PO_PoNumber", - table: "WebApi_PO", - column: "PoNumber", - unique: true, - filter: "[PoNumber] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_Part_Code", - table: "WebApi_Part", - column: "Code", - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", - table: "WebApi_SupplierPart"); - - migrationBuilder.DropIndex( - name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", - table: "WebApi_Receipt"); - - migrationBuilder.DropIndex( - name: "IX_WebApi_PO_PoNumber", - table: "WebApi_PO"); - - migrationBuilder.DropIndex( - name: "IX_WebApi_Part_Code", - table: "WebApi_Part"); - - migrationBuilder.DropColumn( - name: "SequenceNumber", - table: "WebApi_Suppliers"); - - migrationBuilder.DropColumn( - name: "Version", - table: "WebApi_Suppliers"); - - migrationBuilder.DropColumn( - name: "SequenceNumber", - table: "WebApi_SupplierPart"); - - migrationBuilder.DropColumn( - name: "Version", - table: "WebApi_SupplierPart"); - - migrationBuilder.DropColumn( - name: "SequenceNumber", - table: "WebApi_Receipt"); - - migrationBuilder.DropColumn( - name: "Version", - table: "WebApi_Receipt"); - - migrationBuilder.DropColumn( - name: "ConcurrencyStamp", - table: "WebApi_PODetail"); - - migrationBuilder.DropColumn( - name: "ExtraProperties", - table: "WebApi_PODetail"); - - migrationBuilder.DropColumn( - name: "Version", - table: "WebApi_PODetail"); - - migrationBuilder.DropColumn( - name: "SequenceNumber", - table: "WebApi_PO"); - - migrationBuilder.AddColumn( - name: "DeleterId", - table: "WebApi_Suppliers", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.AddColumn( - name: "DeletionTime", - table: "WebApi_Suppliers", - type: "datetime2", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "WebApi_Suppliers", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "DeleterId", - table: "WebApi_SupplierPart", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.AddColumn( - name: "DeletionTime", - table: "WebApi_SupplierPart", - type: "datetime2", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "WebApi_SupplierPart", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "DeleterId", - table: "WebApi_Receipt", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.AddColumn( - name: "DeletionTime", - table: "WebApi_Receipt", - type: "datetime2", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "WebApi_Receipt", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "DeleterId", - table: "WebApi_PO", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.AddColumn( - name: "DeletionTime", - table: "WebApi_PO", - type: "datetime2", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "WebApi_PO", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "DeleterId", - table: "WebApi_Part", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.AddColumn( - name: "DeletionTime", - table: "WebApi_Part", - type: "datetime2", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "WebApi_Part", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", - table: "WebApi_SupplierPart", - columns: new[] { "SupplierCode", "PartCode" }, - unique: true, - filter: "IsDeleted=0"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", - table: "WebApi_Receipt", - columns: new[] { "RcNumber", "PoLine", "PartCode" }, - unique: true, - filter: "IsDeleted=0"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_PO_PoNumber", - table: "WebApi_PO", - column: "PoNumber", - unique: true, - filter: "IsDeleted=0"); - - migrationBuilder.CreateIndex( - name: "IX_WebApi_Part_Code", - table: "WebApi_Part", - column: "Code", - unique: true, - filter: "IsDeleted=0"); - } - } -} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/WebApiHttpApiHostMigrationsDbContextModelSnapshot.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/WebApiHttpApiHostMigrationsDbContextModelSnapshot.cs deleted file mode 100644 index f03ebb1..0000000 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/WebApiHttpApiHostMigrationsDbContextModelSnapshot.cs +++ /dev/null @@ -1,726 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Volo.Abp.EntityFrameworkCore; -using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; - -namespace Win_in.Sfs.Scp.WebApi.Migrations -{ - [DbContext(typeof(WebApiHttpApiHostMigrationsDbContext))] - partial class WebApiHttpApiHostMigrationsDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.11") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("ContactName") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ContactPhone") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DueDate") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsConsignment") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("OrderDate") - .HasColumnType("datetime2"); - - b.Property("PoNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TaxRate") - .HasColumnType("decimal(18,2)"); - - b.Property("Version") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("PoNumber") - .IsUnique() - .HasFilter("[PoNumber] IS NOT NULL"); - - b.ToTable("WebApi_PO"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => - { - b.Property("Id") - .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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsConsignment") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("LineStatus") - .HasColumnType("int"); - - b.Property("OrderQty") - .IsRequired() - .HasColumnType("decimal(18,2)"); - - b.Property("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoLine") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("StdPackQty") - .IsRequired() - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPackConvertRate") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackUom") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("PoNumber", "PoLine") - .IsUnique(); - - b.ToTable("WebApi_PODetail"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Part", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Color") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("Configuration") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("Desc1") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("Desc2") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("Eco") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ExtPackUom") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("Group") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("IsBuyPart") - .HasColumnType("bit"); - - b.Property("IsMakePart") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Project") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("StdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Type") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("abcClass") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("catalog") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("productline") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("WebApi_Part"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Receipt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AsnNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Lot") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - 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("DeliverQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoLine") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PoNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ProductionDate") - .HasColumnType("datetime2"); - - b.Property("RcNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("RcType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ReceiveQty") - .HasColumnType("decimal(18,2)"); - - b.Property("ReceiveTime") - .HasColumnType("datetime2"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("RpNumber") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Site") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("StdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("StdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierLot") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPackConvertRate") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TimeWindowEnd") - .HasColumnType("datetime2"); - - b.Property("TimeWindowBegin") - .HasColumnType("datetime2"); - - b.Property("Uom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Warehouse") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Dock") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("RcNumber", "PoLine", "PartCode") - .IsUnique(); - - b.ToTable("WebApi_Receipt"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Address") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("City") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Company") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("ContactName") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Country") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("Currency") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Desc") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("Fax") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Phone") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("PostId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Rank") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(4096) - .HasColumnType("nvarchar(max)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("WebApi_Suppliers"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.SupplierPart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("PartCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Remark") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SequenceNumber") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierCode") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("SupplierPartCode") - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.Property("SupplierStdPackQty") - .HasColumnType("decimal(18,2)"); - - b.Property("SupplierStdPackUom") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Version") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("SupplierCode", "PartCode") - .IsUnique(); - - b.ToTable("WebApi_SupplierPart"); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => - { - b.HasOne("Win_in.Sfs.Scp.WebApi.PO", null) - .WithMany("PODetails") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - }); - - modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => - { - b.Navigation("PODetails"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs index e33d664..8278b69 100644 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs @@ -35,6 +35,7 @@ using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.SwaggerGen; using System.Reflection; +using Microsoft.AspNetCore.Hosting; using Serilog; using Serilog.Events; using Volo.Abp.AspNetCore.Mvc; @@ -63,41 +64,87 @@ namespace Win_in.Sfs.Scp.WebApi { var hostingEnvironment = context.Services.GetHostingEnvironment(); var configuration = context.Services.GetConfiguration(); - _isMultiTenancy = Convert.ToBoolean(configuration["IsMultiTenancy"]); - Configure(options => - { - options.UseSqlServer(); - }); + ConfigureDbContext(); + + ConfigureMultiTeancy(configuration); + + + + ConfigureSwagger(context, configuration); - Configure(options => + ConfigureLocalization(); + + ConfigureAuthentication(context, configuration); + + ConfigureDistributedCache(context, hostingEnvironment, configuration); + + ConfigureCors(context, configuration); + } + + private static void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddCors(options => { - options.IsEnabled = _isMultiTenancy; + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins( + configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); }); + } - if (hostingEnvironment.IsDevelopment()) + private void ConfigureDistributedCache(ServiceConfigurationContext context, IWebHostEnvironment hostingEnvironment, + IConfiguration configuration) + { + Configure(options => { options.KeyPrefix = "ScpWebApi:"; }); + + if (!hostingEnvironment.IsDevelopment()) { - Configure(options => + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + context.Services + .AddDataProtection() + .PersistKeysToStackExchangeRedis(redis, "WebApi-Protection-Keys"); + } + } + + private static void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => { - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Domain.Shared", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Domain", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Application.Contracts", Path.DirectorySeparatorChar))); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Application", Path.DirectorySeparatorChar))); + options.Authority = configuration["AuthServer:Authority"]; + options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); + options.Audience = "WebApi"; }); - } + } - Configure(options => + private void ConfigureLocalization() + { + Configure(options => { - options - .ConventionalControllers - .Create(typeof(WebApiApplicationModule).Assembly); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); }); + } + private void ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration) + { context.Services.AddAbpSwaggerGenWithOAuth( configuration["AuthServer:Authority"], new Dictionary { - {"WebApi", "WebApi API"} + { "WebApi", "WebApi API" } }, //options => //{ @@ -109,11 +156,10 @@ namespace Win_in.Sfs.Scp.WebApi { //遍历Swagger分组,注册SwaggerDoc foreach (var groupName in typeof(SwaggerGroupConsts).GetFields() - .Select(f => f.GetValue(null).ToString())) + .Select(f => f.GetValue(null).ToString())) { options.SwaggerDoc(groupName, new OpenApiInfo { Title = $"{groupName} API", Version = groupName }); - } //根据APIExplorerSetting判断是否包含于Swagger文档当前分组 @@ -123,71 +169,25 @@ namespace Win_in.Sfs.Scp.WebApi GetXmlFiles().ForEach(file => { options.IncludeXmlComments(file); - Log.Information( " TEST-SWAGGER PATH ==> "+ file); + Log.Information(" TEST-SWAGGER PATH ==> " + file); }); - + options.DocumentFilter(); options.CustomSchemaIds(type => type.FullName); }); + } - Configure(options => - { - options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); - options.Languages.Add(new LanguageInfo("en", "en", "English")); - options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); - options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); - options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); - options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in")); - options.Languages.Add(new LanguageInfo("it", "it", "Italian", "it")); - options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); - options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); - options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); - options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); - options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); - options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); - options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); - }); - - context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) - .AddJwtBearer(options => - { - options.Authority = configuration["AuthServer:Authority"]; - options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); - options.Audience = "WebApi"; - }); - - Configure(options => - { - options.KeyPrefix = "WebApi:"; - }); - - if (!hostingEnvironment.IsDevelopment()) - { - var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); - context.Services - .AddDataProtection() - .PersistKeysToStackExchangeRedis(redis, "WebApi-Protection-Keys"); - } + private void ConfigureMultiTeancy(IConfiguration configuration) + { + _isMultiTenancy = Convert.ToBoolean(configuration["IsMultiTenancy"]); + Configure(options => { options.IsEnabled = _isMultiTenancy; }); + } - context.Services.AddCors(options => - { - options.AddDefaultPolicy(builder => - { - builder - .WithOrigins( - configuration["App:CorsOrigins"] - .Split(",", StringSplitOptions.RemoveEmptyEntries) - .Select(o => o.RemovePostFix("/")) - .ToArray() - ) - .WithAbpExposedHeaders() - .SetIsOriginAllowedToAllowWildcardSubdomains() - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials(); - }); - }); + private void ConfigureDbContext() + { + Configure(options => { options.UseSqlServer(); }); } + /// /// 判断是否应该加入当前分组 /// @@ -283,5 +283,4 @@ namespace Win_in.Sfs.Scp.WebApi app.UseConfiguredEndpoints(); } } - } diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj index d38837a..cf99129 100644 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj @@ -44,4 +44,8 @@ + + + + diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json index ac2b8f1..07eddda 100644 --- a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json @@ -3,8 +3,8 @@ "CorsOrigins": "https://*.WebApi.com,http://localhost:4200,http://localhost:44307,https://localhost:44307" }, "ConnectionStrings": { - "Default": "Server=119.3.213.202,13315;Database=WebApi_Module;User ID=sa;Password=ChangkeTec@2020;connection timeout=600", - "WebApi": "Server=119.3.213.202,13315;Database=WebApi_Module;User ID=sa;Password=ChangkeTec@2020;connection timeout=600" + "Default": "Server=127.0.0.1;Database=ScpWebApi_ABP;User ID=sa;Password=Microsoft2008;connection timeout=600", + "WebApi": "Server=127.0.0.1;Database=ScpWebApi_Module;User ID=sa;Password=Microsoft2008;connection timeout=600" }, "Redis": { "Configuration": "127.0.0.1" diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateDTO.cs deleted file mode 100644 index 980b725..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateDTO.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Win_in.Sfs.Scp.WebApi.POs -{ - /// - /// 采购订单新增DTO(Purchase order create DTO) - /// - public class POCreateDTO : POCreateOrUpdateDTOBase - { - /// - /// 订单号(PoNumber) - /// - [Required] - [Display(Name = "订单号(PoNumber)")] - public string PoNumber { set; get; } - - /// - /// 供应商代码(SupplierCode) - /// - [Required] - [Display(Name = "供应商代码(SupplierCode)")] - public string SupplierCode { set; get; } - - /// - /// 地点(Site) - /// - [Required] - [Display(Name = "地点(Site)")] - public string Site { set; get; } - - /// - /// 公司(Company) - /// - [Required] - [Display(Name = "公司(Company)")] - public string Company { set; get; } - - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateOrUpdateDTOBase.cs deleted file mode 100644 index 8637c98..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateOrUpdateDTOBase.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Application.Dtos; -using Win_in.Sfs.Scp.WebApi.Domain.Shared; - -namespace Win_in.Sfs.Scp.WebApi.POs -{ - /// - /// 采购订单创建更新基础Dto - /// - public abstract class POCreateOrUpdateDTOBase : EntityDtoBase - { - - /// - /// 订单类型(PoType) - /// - [Required] - [Display(Name = "订单类型(PoType)")] - public string PoType { set; get; } - - /// - /// 订单状态(Status) - /// - [Required] - [Display(Name = "订单状态(Status)")] - public int Status { set; get; } - - /// - /// 是否寄存订单(IsConsignment) - /// - [Required] - [Display(Name = "是否寄存订单(IsConsignment)")] - public bool IsConsignment { set; get; } - - /// - /// 订单日期(OrderDate) - /// - [Required] - [Display(Name = "订单日期(OrderDate)")] - public DateTime OrderDate { set; get; } - - /// - /// 截止日期(DueDate) - /// - [Display(Name = "截止日期(DueDate)")] - public DateTime DueDate { set; get; } - - /// - /// 税率(TaxRate) - /// - [Display(Name = "税率(TaxRate)")] - public decimal TaxRate { set; get; } - - /// - /// 联系人(ContactName) - /// - [Display(Name = "联系人(ContactName)")] - public string ContactName { set; get; } - - /// - /// 联系电话(ContactPhone) - /// - [Display(Name = "联系电话(ContactPhone)")] - public string ContactPhone { set; get; } - - /// - /// 备注(Remark) - /// - [Display(Name = "备注(Remark)")] - public string Remark { set; get; } - - - public virtual ICollection Details { get; set; } - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POUpdateDTO.cs deleted file mode 100644 index b647199..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POUpdateDTO.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Win_in.Sfs.Scp.WebApi.POs -{ - /// - /// 采购订单更新DTO(Purchase order update DTO) - /// - public class POUpdateDTO : POCreateOrUpdateDTOBase - { - /// - /// 并发时间戳(Concurrency Stamp) - /// - [Display(Name = "并发时间戳(Concurrency Stamp)")] - public string ConcurrencyStamp { get; set; } - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs index 845b478..35c1492 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs @@ -9,10 +9,10 @@ namespace Win_in.Sfs.Scp.WebApi.Parts /// /// Part接口 /// - public interface IPartAppService : ICrudAppService + public interface IPartAppService : IReadOnlyAppService { + Task CreateAsync(PartDTO partCreateDTO); - } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDTO.cs deleted file mode 100644 index 73fca63..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDTO.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Win_in.Sfs.Scp.WebApi.Parts -{ - /// - /// 零件新增DTO(Part create DTO) - /// - public class PartCreateDTO : PartCreateOrUpdateDTOBase - { - /// - /// 代码(Code) - /// - [Required] - [Display(Name = "代码")] - public string Code { get; set; } - - /// - /// 地点(Site) - /// - [Required] - [Display(Name = "地点")] - public string Site { get; set; } - - /// - /// 公司(Company) - /// - [Required] - [Display(Name = "公司")] - public string Company { get; set; } - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateOrUpdateDTOBase.cs deleted file mode 100644 index 511cd45..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateOrUpdateDTOBase.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Data; -using Win_in.Sfs.Scp.WebApi.Domain.Shared; - -namespace Win_in.Sfs.Scp.WebApi.Parts -{ - /// - /// 零件创建更新基础Dto - /// - public abstract class PartCreateOrUpdateDTOBase : EntityDtoBase,IHasExtraProperties - { - - - - /// - /// 名称(Name) - /// - [Required] - [Display(Name = "名称")] - public string Name { get; set; } - - /// - /// 描述(Desc1) - /// - [Display(Name = "描述")] - public string Desc1 { get; set; } - - /// - /// 描述2(Desc2) - /// - [Display(Name = "描述2")] - public string Desc2 { get; set; } - - /// - /// 状态(Status) - /// - [Required] - [Display(Name = "状态")] - public string Status { get; set; } - - /// - /// 制造件(Can make) - /// - [Required] - [Display(Name = "制造件")] - public bool CanMake { get; set; } - - /// - /// 采购件(Can buy) - /// - [Required] - [Display(Name = "采购件")] - public bool CanBuy { get; set; } - - /// - /// 计量单位(Uom) - /// - [Required] - [Display(Name = "计量单位")] - public string Uom { get; set; } - - /// - /// ABC类(abcClass) - /// - [Required] - [Display(Name = "ABC类")] - public string AbcClass { get; set; } - - /// - /// 产品类(Product line) - /// - [Display(Name = "产品类")] - public string ProductLine { get; set; } - - /// - /// 类型(Type) - /// - [Display(Name = "类型")] - public string Type { get; set; } - - /// - /// 种类(Catalog) - /// - [Display(Name = "种类")] - public string Catalog { get; set; } - - /// - /// 分组(Group) - /// - [Display(Name = "分组")] - public string Group { get; set; } - - /// - /// 颜色(Color) - /// - [Display(Name = "颜色")] - public string Color { get; set; } - - /// - /// 配置(Configuration) - /// - [Display(Name = "配置")] - public string Configuration { get; set; } - - /// - /// 项目(Project) - /// - [Display(Name = "项目")] - public string Project { get; set; } - - /// - /// 工程变更通知单(Engineering change order) - /// - [Display(Name = "工程变更通知单")] - public string Eco { get; set; } - - /// - /// 标包计量单位(Standard Pack Uom) - /// - [Required] - [Display(Name = "标包计量单位")] - public string StdPackUom { get; set; } - - /// - /// 标包数量(Standard Pack Qty) - /// - [Required] - [Display(Name = "标包数量")] - public decimal StdPackQty { get; set; } - - /// - /// 替代计量单位(Extra Pack UM) - /// - [Display(Name = "替代计量单位")] - public string ExtPackUom { get; set; } - - /// - /// 替代包装数量(Extra Pack Qty) - /// - [Display(Name = "替代包装数量")] - public decimal ExtPackQty { get; set; } - - /// - /// 扩展属性(Extra Properties) - /// - [Display(Name = "扩展属性(Extra Properties)")] - public ExtraPropertyDictionary ExtraProperties { get; set; } - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartUpdateDTO.cs deleted file mode 100644 index da1407e..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartUpdateDTO.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Win_in.Sfs.Scp.WebApi.Parts -{ - /// - /// 零件更新DTO(Part update DTO) - /// - public class PartUpdateDTO : PartCreateOrUpdateDTOBase - { - /// - /// 并发时间戳(Concurrency Stamp) - /// - [Display(Name = "并发时间戳(Concurrency Stamp)")] - public string ConcurrencyStamp { get; set; } - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/IPOAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/IPurchaseOrderAppService.cs similarity index 58% rename from ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/IPOAppService.cs rename to ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/IPurchaseOrderAppService.cs index 769ac33..673795a 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/IPOAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/IPurchaseOrderAppService.cs @@ -9,9 +9,9 @@ namespace Win_in.Sfs.Scp.WebApi.POs /// /// PO接口 /// - public interface IPOAppService : ICrudAppService + public interface IPurchaseOrderAppService : IReadOnlyAppService { - + Task CreateAsync(PurchaseOrderDTO poCreateDTO); } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderDTO.cs similarity index 94% rename from ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODTO.cs rename to ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderDTO.cs index 5c5d3c2..8625064 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODTO.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderDTO.cs @@ -9,7 +9,7 @@ namespace Win_in.Sfs.Scp.WebApi.POs /// /// 采购订单DTO(Purchase order DTO) /// - public class PODTO : EntityDtoBase + public class PurchaseOrderDTO : EntityDtoBase { /// @@ -91,6 +91,6 @@ namespace Win_in.Sfs.Scp.WebApi.POs public string Remark { set; get; } - public virtual ICollection Details { get; set; } + public virtual ICollection Details { get; set; } } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODetailDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderDetailDTO.cs similarity index 97% rename from ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODetailDTO.cs rename to ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderDetailDTO.cs index babdd6c..afc8b09 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODetailDTO.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderDetailDTO.cs @@ -8,7 +8,7 @@ namespace Win_in.Sfs.Scp.WebApi.POs /// /// 采购订单明细DTO(Purchase order detail DTO) /// - public class PODetailDTO : EntityDetailBase + public class PurchaseOrderDetailDTO : EntityDetailDtoBase { /// /// 订单号(PoNumber) diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs index b8d34d3..a85f2e2 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs @@ -5,7 +5,7 @@ using Volo.Abp.Application.Services; namespace Win_in.Sfs.Scp.WebApi.Receipts { - public interface IReceiptAppService : ICrudAppService + public interface IReceiptAppService : IReadOnlyAppService { } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs deleted file mode 100644 index bfb9fe8..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Win_in.Sfs.Scp.WebApi.Receipts -{ - /// - /// ջDTO(Receipt create DTO) - /// - public class ReceiptCreateDTO : ReceiptCreateOrUpdateDTOBase - { - /// - /// ջ(RcNumber) - /// - [Required] - [Display(Name = "ջ(RcNumber)")] - public string RcNumber { set; get; } - - /// - /// (AsnNumber) - /// - [Required] - [Display(Name = "(AsnNumber)")] - public string AsnNumber { set; get; } - - /// - /// Ҫƻ(RpNumber) - /// - [Required] - [Display(Name = "Ҫƻ(RpNumber)")] - public string RpNumber { set; get; } - - /// - /// (PoNumber) - /// - [Required] - [Display(Name = "(PoNumber)")] - public string PoNumber { set; get; } - - /// - /// Ӧ̴(PoNumber) - /// - [Required] - [Display(Name = "Ӧ̴(SupplierCode)")] - public string SupplierCode { set; get; } - - /// - /// ջ(RcType) - /// "" :ջ(Receipts) - /// "R":˻(Return Document) - /// - [Required] - [Display(Name = "ջ(RcType)")] - public string RcType { set; get; } - - - /// - /// ص(Site) - /// - [Required] - [Display(Name = "ص(Site)")] - public string Site { set; get; } - - /// - /// ˾(Company) - /// - [Required] - [Display(Name = "˾(Company)")] - public string Company { set; get; } - - /// - /// (PoLine) - /// - [Required] - [Display(Name = "(PoLine)")] - public string PoLine { set; get; } - - /// - /// (PartCode) - /// - [Required] - [Display(Name = "(PartCode)")] - public string PartCode { set; get; } - - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateOrUpdateDTOBase.cs deleted file mode 100644 index 68a58b4..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateOrUpdateDTOBase.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Application.Dtos; -using Win_in.Sfs.Scp.WebApi.Domain.Shared; - -namespace Win_in.Sfs.Scp.WebApi.Receipts -{ - public abstract class ReceiptCreateOrUpdateDTOBase : EntityDtoBase - { - - - /// - /// 仓库(Warehouse) - /// - [Required] - [Display(Name = "仓库(Warehouse)")] - public string Warehouse { set; get; } - - /// - /// 收货口(Dock) - /// - [Required] - [Display(Name = "收货口(Dock)")] - public string Dock { set; get; } - - /// - /// 时间窗口开始(TimeWindowBegin) - /// - [Display(Name = "时间窗口开始(TimeWindowBegin)")] - public DateTime TimeWindowBegin { set; get; } - - /// - /// 时间窗口结束(TimeWindowEnd) - /// - [Display(Name = "时间窗口结束(TimeWindowEnd)")] - public DateTime TimeWindowEnd { set; get; } - - /// - /// 收货日期(ReceiveDate) - /// - [Required] - [Display(Name = "收货日期(ReceiveDate)")] - public DateTime ReceiveDate { set; get; } - - /// - /// 收货时间(ReceiveTime) - /// - [Required] - [Display(Name = "收货时间(ReceiveTime)")] - public DateTime ReceiveTime { set; get; } - - /// - /// 批次(Lot) - /// - [Required] - [Display(Name = "批次(Lot)")] - public string Lot { set; get; } - - /// - /// 供应商批次(SupplierLot) - /// - [Display(Name = "供应商批次(SupplierLot)")] - public string SupplierLot { set; get; } - - /// - /// 生产日期(ProductionDate) - /// - [Display(Name = "生产日期(ProductionDate)")] - public DateTime ProductionDate { set; get; } - - /// - /// 计量单位(Uom) - /// - [Required] - [Display(Name = "计量单位(Uom)")] - public string Uom { set; get; } - - /// - /// 发货数量(DeliverQty) - /// - [Required] - [Display(Name = "发货数量(DeliverQty)")] - public decimal DeliverQty { set; get; } - - /// - /// 收货数量(ReceiveQty) - /// - [Required] - [Display(Name = "收货数量(ReceiveQty)")] - public decimal ReceiveQty { set; get; } - - /// - /// 标包计量单位(Standard Pack Uom) - /// - [Display(Name = "标包计量单位(Standard Pack Uom)")] - public string StdPackUom { set; get; } - - /// - /// 标包数量(Standard Pack Qty) - /// - [Display(Name = "标包数量(Standard Pack Qty)")] - public decimal StdPackQty { set; get; } - - /// - /// 供应商计量单位(SupplierPackUom) - /// - [Display(Name = "供应商计量单位(SupplierPackUom)")] - public string SupplierPackUom { set; get; } - - /// - /// 供应商包装数量(SupplierPackQty) - /// - [Display(Name = "供应商包装数量(SupplierPackQty)")] - public decimal SupplierPackQty { set; get; } - - /// - /// 供应商包装转换率(SupplierPackConvertRate) - /// - [Required] - [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] - public decimal SupplierPackConvertRate { set; get; } - - /// - /// 备注(Remark) - /// - [Display(Name = "备注(Remark)")] - public string Remark { set; get; } - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptUpdateDTO.cs deleted file mode 100644 index 264800b..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptUpdateDTO.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using Win_in.Sfs.Scp.WebApi.Receipts; - -namespace Win_in.Sfs.Scp.WebApi.Receipts -{ - /// - /// ջDTO(Receipt update DTO) - /// - public class ReceiptUpdateDTO : ReceiptCreateOrUpdateDTOBase - { - /// - /// ʱ(Concurrency Stamp) - /// - [Display(Name = "ʱ(Concurrency Stamp)")] - public string ConcurrencyStamp { get; set; } - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs index c7113ea..bf879b8 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs @@ -6,7 +6,7 @@ using Win_in.Sfs.Scp.WebApi.Suppliers; namespace Win_in.Sfs.Scp.WebApi.Suppliers { - public interface ISupplierAppService : ICrudAppService + public interface ISupplierAppService : IReadOnlyAppService { } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs deleted file mode 100644 index 619267f..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Win_in.Sfs.Scp.WebApi.Suppliers -{ - /// - /// ӦDTO(Supplier create DTO) - /// - public class SupplierCreateDTO : SupplierCreateOrUpdateDTOBase - { - /// - /// (Code) - /// - [Required] - [Display(Name = "(Code)")] - public string Code { set; get; } - - /// - /// ˾(Company) - /// - [Required] - [Display(Name = "˾(Company)")] - public string Company { set; get; } - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateOrUpdateDTOBase.cs deleted file mode 100644 index 5e250a0..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateOrUpdateDTOBase.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Application.Dtos; -using Win_in.Sfs.Scp.WebApi.Domain.Shared; - -namespace Win_in.Sfs.Scp.WebApi.Suppliers -{ - public abstract class SupplierCreateOrUpdateDTOBase : EntityDtoBase - { - - - /// - /// 简称(Name) - /// - [Required] - [Display(Name = "简称(Name)")] - public string Name { set; get; } - - /// - /// 描述(Description) - /// - [Display(Name = "描述(Description)")] - public string Desc { set; get; } - - /// - /// 级别(Rank) - /// - [Display(Name = "级别(Rank)")] - public string Rank { get; set; } - - /// - /// 地址 - /// - [Display(Name = "地址(Address)")] - public string Address { get; set; } - - /// - /// 国家(Country) - /// - [Display(Name = "国家(Country)")] - public string Country { get; set; } - - /// - /// 城市(City) - /// - [Display(Name = "城市(City)")] - public string City { get; set; } - - /// - /// 电话(Phone) - /// - [Display(Name = "电话(Phone)")] - public string Phone { set; get; } - - /// - /// 传真(Fax) - /// - [Display(Name = "传真(Fax)")] - public string Fax { set; get; } - - /// - /// 邮编(PostId) - /// - [Display(Name = "邮编(PostId)")] - public string PostId { set; get; } - - /// - /// 联系人(ContactName) - /// - [Display(Name = "联系人(ContactName)")] - public string ContactName { set; get; } - - /// - /// 货币(Currency) - /// - [Display(Name = "货币(Currency)")] - public string Currency { set; get; } - - /// - /// 是否激活(IsActive) - /// - [Display(Name = "是否激活(IsActive)")] - public bool IsActive { set; get; } - - /// - /// 备注(Remark) - /// - [Display(Name = "备注(Remark)")] - public string Remark { set; get; } - - /// - /// 银行(Bank) - /// - [Display(Name = "银行(Bank)")] - public string Bank { set; get; } - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierUpdateDTO.cs deleted file mode 100644 index 515ae1f..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierUpdateDTO.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities; - -namespace Win_in.Sfs.Scp.WebApi.Suppliers -{ - /// - /// Ӧ̸DTO(Supplier update DTO) - /// - public class SupplierUpdateDTO : SupplierCreateOrUpdateDTOBase, IHasConcurrencyStamp - { - /// - /// ʱ(Concurrency Stamp) - /// - [Display(Name = "ʱ(Concurrency Stamp)")] - public string ConcurrencyStamp { get; set; } - } -} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj index fb4d60a..3457f1e 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj @@ -12,9 +12,15 @@ + + + + + + @@ -24,7 +30,6 @@ - diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs index bc4a612..1ced4a4 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs @@ -24,6 +24,7 @@ namespace Win_in.Sfs.Scp.WebApi.ASNs public ASNAppService(IASNRepository repository) : base(repository) { _asnRepository = repository; + } /// diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/POs/POAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/POs/POAppService.cs deleted file mode 100644 index e895123..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/POs/POAppService.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace Win_in.Sfs.Scp.WebApi.POs -{ - /// - /// 采购订单服务 - /// - [AllowAnonymous] - [Route("api/scp/po")] - [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] - public class POAppService : CrudAppService, IPOAppService - { - private readonly IPORepository _partRepository; - - public POAppService(IPORepository repository) : base(repository) - { - _partRepository = repository; - } - - - /// - /// 按ID获取采购订单 (Get purchase order by ID) - /// - /// 唯一ID(unique ID) - /// - [HttpGet] - [Route("{id}")] - public override Task GetAsync(Guid id) - { - return base.GetAsync(id); - } - - - /// - /// 按条件获取采购订单列表 (Get purchase order list by request condition) - /// - /// 请求条件DTO(Request condition DTO) - /// - [HttpGet] - [Route("")] - public override Task> GetListAsync(RequestDTO requestDTO) - { - return base.GetListAsync(requestDTO); - } - - - /// - /// 新增采购订单(Create New purchase order) - /// - /// - [HttpPost] - [Route("")] - public override Task CreateAsync(POCreateDTO poCreateDTO) - { - return base.CreateAsync(poCreateDTO); - } - - /// - /// 按ID修改采购订单 (Modify purchase order by ID) - /// - /// 唯一ID(unique ID) - /// - [HttpPut] - [Route("{id}")] - public override Task UpdateAsync(Guid id, POUpdateDTO poUpdateDTO) - { - return base.UpdateAsync(id, poUpdateDTO); - } - - /// - /// 按ID删除采购订单 (Delete purchase order by ID) - /// - /// 唯一ID(unique ID) - /// - [HttpDelete] - [Route("{id}")] - public override Task DeleteAsync(Guid id) - { - return base.DeleteAsync(id); - } - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs index aa5f18c..f400db7 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs @@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Threading.Tasks; +using AutoMapper; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; -using Win_in.Sfs.Scp.WebApi.ASNs; namespace Win_in.Sfs.Scp.WebApi.Parts { @@ -14,10 +14,10 @@ namespace Win_in.Sfs.Scp.WebApi.Parts /// 零件服务 /// [AllowAnonymous] - [Route("api/scp/Part")] + [Route("api/scp/part")] [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] - public class PartAppService : CrudAppService, IPartAppService + public class PartAppService :ReadOnlyAppService, IPartAppService { private readonly IPartRepository _partRepository; @@ -31,11 +31,12 @@ namespace Win_in.Sfs.Scp.WebApi.Parts /// /// 唯一ID(unique ID) /// + [HttpGet] [Route("{id}")] - public override Task GetAsync(Guid id) + public override async Task GetAsync(Guid id) { - return base.GetAsync(id); + return await base.GetAsync(id); } @@ -46,9 +47,9 @@ namespace Win_in.Sfs.Scp.WebApi.Parts /// [HttpGet] [Route("")] - public override Task> GetListAsync(RequestDTO requestDTO) + public override async Task> GetListAsync(RequestDTO requestDTO) { - return base.GetListAsync(requestDTO); + return await base.GetListAsync(requestDTO); } /// @@ -57,33 +58,13 @@ namespace Win_in.Sfs.Scp.WebApi.Parts /// [HttpPost] [Route("")] - public override Task CreateAsync(PartCreateDTO partCreateDTO) + public async Task CreateAsync(PartDTO partCreateDTO) { - return base.CreateAsync(partCreateDTO); + var entity = ObjectMapper.Map(partCreateDTO); + var ret= await _partRepository.InsertAsync(entity); + var dto = ObjectMapper.Map(ret); + return dto; } - /// - /// 按ID修改零件 (Modify part by ID) - /// - /// 唯一ID(unique ID) - /// - [HttpPut] - [Route("{id}")] - public override Task UpdateAsync(Guid id, PartUpdateDTO partUpdateDTO) - { - return base.UpdateAsync(id, partUpdateDTO); - } - - /// - /// 按ID删除实体 (Delete part by ID) - /// - /// 唯一ID(unique ID) - /// - [HttpDelete] - [Route("{id}")] - public override Task DeleteAsync(Guid id) - { - return base.DeleteAsync(id); - } } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs new file mode 100644 index 0000000..0ef889b --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs @@ -0,0 +1,69 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Win_in.Sfs.Scp.WebApi.Parts; + +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// 采购订单服务 + /// + [AllowAnonymous] + [Route("api/scp/po")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + public class PurchaseOrderAppService : ReadOnlyAppService, IPurchaseOrderAppService + { + private readonly IPurchaseOrderRepository _purchaseOrderRepository; + + public PurchaseOrderAppService(IPurchaseOrderRepository repository) : base(repository) + { + _purchaseOrderRepository = repository; + } + + + /// + /// 按ID获取采购订单 (Get purchase order by ID) + /// + /// 唯一ID(unique ID) + /// + [HttpGet] + [Route("{id}")] + public override async Task GetAsync(Guid id) + { + return await base.GetAsync(id); + } + + + /// + /// 按条件获取采购订单列表 (Get purchase order list by request condition) + /// + /// + [HttpGet] + [Route("")] + public override async Task> GetListAsync(RequestDTO input) + { + return await base.GetListAsync(input); + } + + + + /// + /// 新增采购订单(Create New purchase order) + /// + /// + [HttpPost] + [Route("")] + public async Task CreateAsync(PurchaseOrderDTO poCreateDTO) + { + var entity = ObjectMapper.Map(poCreateDTO); + var ret = await _purchaseOrderRepository.InsertAsync(entity); + var dto = ObjectMapper.Map(ret); + return dto; + } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs index 1036960..8ce5ede 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs @@ -14,13 +14,13 @@ namespace Win_in.Sfs.Scp.WebApi.Receipts [AllowAnonymous] [Route("api/scp/receipt")] [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] - public class ReceiptAppService : CrudAppService, IReceiptAppService + public class ReceiptAppService : ReadOnlyAppService, IReceiptAppService { - private readonly IReceiptRepository _partRepository; + private readonly IReceiptRepository _receiptRepository; public ReceiptAppService(IReceiptRepository repository) : base(repository) { - _partRepository = repository; + _receiptRepository = repository; } @@ -31,9 +31,9 @@ namespace Win_in.Sfs.Scp.WebApi.Receipts /// [HttpGet] [Route("{id}")] - public override Task GetAsync(Guid id) + public override async Task GetAsync(Guid id) { - return base.GetAsync(id); + return await base.GetAsync(id); } @@ -44,9 +44,9 @@ namespace Win_in.Sfs.Scp.WebApi.Receipts /// [HttpGet] [Route("")] - public override Task> GetListAsync(RequestDTO requestDTO) + public override async Task> GetListAsync(RequestDTO requestDTO) { - return base.GetListAsync(requestDTO); + return await base.GetListAsync(requestDTO); } @@ -57,9 +57,12 @@ namespace Win_in.Sfs.Scp.WebApi.Receipts /// [HttpPost] [Route("")] - public override Task CreateAsync(ReceiptCreateDTO receiptCreateDTO) + public async Task CreateAsync(ReceiptDTO receiptCreateDTO) { - return base.CreateAsync(receiptCreateDTO); + var entity = ObjectMapper.Map(receiptCreateDTO); + var ret = await _receiptRepository.InsertAsync(entity); + var dto = ObjectMapper.Map(ret); + return dto; } /// /// 按ID修改收货单(Update receipt by ID) @@ -67,24 +70,7 @@ namespace Win_in.Sfs.Scp.WebApi.Receipts /// 唯一ID(unique ID) /// /// - [HttpPut] - [Route("{id}")] - public override Task UpdateAsync(Guid id, ReceiptUpdateDTO receiptUpdateDTO) - { - return base.UpdateAsync(id, receiptUpdateDTO); - } - - /// - /// 按ID删除收货单(Delete receipt by ID) - /// - /// 唯一ID(unique ID) - /// - [HttpDelete] - [Route("{id}")] - public override Task DeleteAsync(Guid id) - { - return base.DeleteAsync(id); - } + } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs index f9283cf..6d38d0c 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs @@ -15,13 +15,13 @@ namespace Win_in.Sfs.Scp.WebApi.Suppliers [AllowAnonymous] [Route("api/scp/supplier")] [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] - public class SuppliersAppService : CrudAppService, ISupplierAppService + public class SuppliersAppService : ReadOnlyAppService, ISupplierAppService { - private readonly ISupplierRepository _partRepository; + private readonly ISupplierRepository _supplierRepository; public SuppliersAppService(ISupplierRepository repository) : base(repository) { - _partRepository = repository; + _supplierRepository = repository; } @@ -32,9 +32,9 @@ namespace Win_in.Sfs.Scp.WebApi.Suppliers /// [HttpGet] [Route("{id}")] - public override Task GetAsync(Guid id) + public override async Task GetAsync(Guid id) { - return base.GetAsync(id); + return await base.GetAsync(id); } @@ -45,9 +45,9 @@ namespace Win_in.Sfs.Scp.WebApi.Suppliers /// [HttpGet] [Route("")] - public override Task> GetListAsync(RequestDTO requestDTO) + public override async Task> GetListAsync(RequestDTO requestDTO) { - return base.GetListAsync(requestDTO); + return await base.GetListAsync(requestDTO); } @@ -58,35 +58,14 @@ namespace Win_in.Sfs.Scp.WebApi.Suppliers /// 供应商DTO(Supplier DTO) [HttpPost] [Route("")] - public override Task CreateAsync(SupplierCreateDTO supplierCreateDTO) + public async Task CreateAsync(SupplierDTO supplierCreateDTO) { - return base.CreateAsync(supplierCreateDTO); - } - - /// - /// 按ID修改供应商 (Modify supplier by id) - /// - /// 唯一ID(unique ID) - /// 新的供应商DTO(new supplier DTO) - /// 供应商DTO(Supplier DTO) - [HttpPut] - [Route("{id}")] - public override Task UpdateAsync(Guid id, SupplierUpdateDTO supplierUpdateDTO) - { - return base.UpdateAsync(id, supplierUpdateDTO); - } - - /// - /// 按ID删除供应商 (Delete supplier by id) - /// - /// 唯一ID(unique ID) - /// 无(void) - [HttpDelete] - [Route("{id}")] - public override Task DeleteAsync(Guid id) - { - return base.DeleteAsync(id); + var entity = ObjectMapper.Map(supplierCreateDTO); + var ret = await _supplierRepository.InsertAsync(entity); + var dto = ObjectMapper.Map(ret); + return dto; } + } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs index b082ee0..c1956ef 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs @@ -1,9 +1,7 @@ using AutoMapper; -using Win_in.Sfs.Scp.WebApi.ASNs; using Win_in.Sfs.Scp.WebApi.Parts; using Win_in.Sfs.Scp.WebApi.POs; using Win_in.Sfs.Scp.WebApi.Receipts; -using Win_in.Sfs.Scp.WebApi.SupplierParts; using Win_in.Sfs.Scp.WebApi.Suppliers; namespace Win_in.Sfs.Scp.WebApi @@ -18,8 +16,10 @@ namespace Win_in.Sfs.Scp.WebApi CreateMapPart(); CreateMapSupplier(); - CreateMapSupplierPart(); CreateMapReceipt(); + CreateMapPurchaseOrder(); + CreateMapPurchaseOrderDetail(); + } /// @@ -29,8 +29,6 @@ namespace Win_in.Sfs.Scp.WebApi { CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); } /// @@ -40,21 +38,9 @@ namespace Win_in.Sfs.Scp.WebApi { CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - } - - /// - /// 供应商零件实体与Dto映射 - /// - private void CreateMapSupplierPart() - - { - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); } + /// /// 收货单与退货单明细实体与Dto映射 /// @@ -62,29 +48,25 @@ namespace Win_in.Sfs.Scp.WebApi { CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); } /// /// 采购订单主表映射 /// - private void CreateMapPO() + private void CreateMapPurchaseOrder() { - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } /// /// 采购订单明细表映射 /// - private void CreateMapPODetial() + private void CreateMapPurchaseOrderDetail() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj index badfc2f..35038c2 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj @@ -12,9 +12,15 @@ + + + + + + @@ -25,8 +31,4 @@ - - - - diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs index a8d647a..1196211 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs @@ -4,19 +4,9 @@ using Volo.Abp.Domain.Entities.Auditing; namespace Win_in.Sfs.Scp.WebApi.Domain.Shared { - public class EntityBase : AuditedAggregateRoot + public class EntityBase : CreationAuditedAggregateRoot { - /// - /// 序列(SequenceNumber) - /// - [Display(Name = "序列(SequenceNumber)")] - public string SequenceNumber { set; get; } - - /// - /// 版本(Name) - /// - [Display(Name = "版本(Version)")] - public string Version { set; get; } + } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs index 243afcd..ea6bc8f 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs @@ -5,15 +5,9 @@ using Volo.Abp.Domain.Entities.Auditing; namespace Win_in.Sfs.Scp.WebApi.Domain.Shared { - public class EntityDetailBase : AuditedAggregateRoot + public class EntityDetailBase : CreationAuditedEntity { - /// - /// 版本(Name) - /// - [Display(Name = "版本(Version)")] - public string Version { set; get; } - public EntityDetailBase() { } public EntityDetailBase(TKey id) : base(id) { } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs index 4e9acbb..513c511 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs @@ -5,14 +5,9 @@ using Volo.Abp.Domain.Entities.Auditing; namespace Win_in.Sfs.Scp.WebApi.Domain.Shared { - public class EntityDetailDtoBase : AuditedEntityDto + public class EntityDetailDtoBase : CreationAuditedEntityDto { - - /// - /// 版本(Name) - /// - [Display(Name = "版本(Version)")] - public string Version { set; get; } + } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs index 38731eb..0c73996 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs @@ -5,19 +5,9 @@ using Volo.Abp.Domain.Entities.Auditing; namespace Win_in.Sfs.Scp.WebApi.Domain.Shared { - public class EntityDtoBase : AuditedEntityDto + public class EntityDtoBase : CreationAuditedEntityDto { - /// - /// 序列(SequenceNumber) - /// - [Display(Name = "序列(SequenceNumber)")] - public string SequenceNumber { set; get; } - - /// - /// 版本(Name) - /// - [Display(Name = "版本(Version)")] - public string Version { set; get; } + } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/ar.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/ar.json deleted file mode 100644 index 6b75803..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/ar.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "ar", - "texts": { - "MyAccount": "إدارة ملفى", - "SamplePageMessage": "صفحة نموذجية للوحدة النمطية WebApi" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/cs.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/cs.json deleted file mode 100644 index 30361d7..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/cs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "cs", - "texts": { - "MyAccount": "Spravovat profil", - "SamplePageMessage": "Ukázková stránka pro modul WebApi" - } -} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/de-DE.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/de-DE.json deleted file mode 100644 index ac2a364..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/de-DE.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "de-DE", - "texts": { - "MyAccount": "Mein Konto", - "SamplePageMessage": "Eine Beispielseite für das Modul WebApiModul" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en-GB.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en-GB.json deleted file mode 100644 index 82bb2e9..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en-GB.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "en-GB", - "texts": { - "MyAccount": "My account", - "SamplePageMessage": "A sample page for the WebApi module" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/es.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/es.json deleted file mode 100644 index 3d8e3ad..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/es.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "es", - "texts": { - "MyAccount": "Mi cuenta", - "SamplePageMessage": "Una página de ejemplo para el módulo WebApi " - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fi.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fi.json deleted file mode 100644 index 096a28f..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fi.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "fi", - "texts": { - "MyAccount": "Tilini", - "SamplePageMessage": "Esimerkkisivu WebApi-moduulille" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fr.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fr.json deleted file mode 100644 index 8bba6f6..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "fr", - "texts": { - "MyAccount": "Mon compte", - "SamplePageMessage": "Exemple de page pour le module WebApi" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hi.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hi.json deleted file mode 100644 index 936ea28..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hi.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "hi", - "texts": { - "MyAccount": "मेरा खाता", - "SamplePageMessage": "WebApi मॉड्यूल के लिए एक नमूना पृष्ठ" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hu.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hu.json deleted file mode 100644 index 9d918d7..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hu.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "hu", - "texts": { - "MyAccount": "A fiókom", - "SamplePageMessage": "Mintaoldal a WebApi modulhoz" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/it.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/it.json deleted file mode 100644 index f067b52..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/it.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "it", - "texts": { - "MyAccount": "Il mio conto", - "SamplePageMessage": "Una pagina di esempio per il modulo WebApi" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/nl.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/nl.json deleted file mode 100644 index cfb281c..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/nl.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "nl", - "texts": { - "MyAccount": "Mijn rekening", - "SamplePageMessage": "Een voorbeeldpagina voor de WebApi module" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pl-PL.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pl-PL.json deleted file mode 100644 index 3ea7b19..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pl-PL.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "pl-PL", - "texts": { - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pt-BR.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pt-BR.json deleted file mode 100644 index 6d746df..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pt-BR.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "pt-BR", - "texts": { - - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sk.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sk.json deleted file mode 100644 index c185f4c..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sk.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "sk", - "texts": { - "SamplePageMessage": "Ukážka stránky pre modul WebApi" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sl.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sl.json deleted file mode 100644 index 229c449..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sl.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "sl", - "texts": { - "MyAccount": "Moj račun" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/tr.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/tr.json deleted file mode 100644 index 267efce..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/tr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "culture": "tr", - "texts": { - "MyAccount": "Hesabım", - "SamplePageMessage": "WebApi modulünden örnek bir sayfa" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/vi.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/vi.json deleted file mode 100644 index d8eb5f3..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/vi.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "vi", - "texts": { - - } -} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hant.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hant.json deleted file mode 100644 index 699d31e..0000000 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hant.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "zh-Hant", - "texts": { - "MyAccount": "我的賬戶" - } -} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs index 7394d9a..e6ce9ce 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs @@ -88,59 +88,59 @@ namespace Win_in.Sfs.Scp.WebApi [Display(Name = "分组")] public string Group {get;set;} - ///// - ///// 颜色(Color) - ///// - //[Display(Name = "颜色")] - //public string Color {get;set;} + /// + /// 颜色(Color) + /// + [Display(Name = "颜色")] + public string Color {get;set;} - ///// - ///// 配置(Configuration) - ///// - //[Display(Name = "配置")] - //public string Configuration {get;set;} + /// + /// 配置(Configuration) + /// + [Display(Name = "配置")] + public string Configuration {get;set;} - ///// - ///// 项目(Project) - ///// - //[Display(Name = "项目")] - //public string Project {get;set;} + /// + /// 项目(Project) + /// + [Display(Name = "项目")] + public string Project {get;set;} /// /// 版本(version) /// - //[Display(Name = "版本")] - //public string version {get;set;} + [Display(Name = "版本")] + public string version {get;set;} /// /// 工程变更通知单(Engineering change order) /// - //[Display(Name = "工程变更通知单")] - //public string Eco {get;set;} - - ///// - ///// 标包计量单位(Standard Pack Uom) - ///// - //[Display(Name = "标包计量单位")] - //public string StdPackUom {get;set;} - - ///// - ///// 标包数量(Standard Pack Qty) - ///// - //[Display(Name = "标包数量")] - //public decimal StdPackQty {get;set;} - - ///// - ///// 替代计量单位(Extra Pack UM) - ///// - //[Display(Name = "替代计量单位")] - //public string ExtPackUom {get;set;} - - ///// - ///// 替代包装数量(Extra Pack Qty) - ///// - //[Display(Name = "替代包装数量")] - //public decimal ExtPackQty {get;set;} + [Display(Name = "工程变更通知单")] + public string Eco {get;set;} + + /// + /// 标包计量单位(Standard Pack Uom) + /// + [Display(Name = "标包计量单位")] + public string StdPackUom {get;set;} + + /// + /// 标包数量(Standard Pack Qty) + /// + [Display(Name = "标包数量")] + public decimal StdPackQty {get;set;} + + /// + /// 替代计量单位(Extra Pack UM) + /// + [Display(Name = "替代计量单位")] + public string ExtPackUom {get;set;} + + /// + /// 替代包装数量(Extra Pack Qty) + /// + [Display(Name = "替代包装数量")] + public decimal ExtPackQty {get;set;} /// /// 地点(Site) diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierPartRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/IPurchaseOrderRepository.cs similarity index 55% rename from ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierPartRepository.cs rename to ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/IPurchaseOrderRepository.cs index d0312b7..e043f46 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierPartRepository.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/IPurchaseOrderRepository.cs @@ -3,7 +3,7 @@ using Volo.Abp.Domain.Repositories; namespace Win_in.Sfs.Scp.WebApi { - public interface ISupplierPartRepository : IRepository + public interface IPurchaseOrderRepository : IRepository { } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrder.cs similarity index 86% rename from ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs rename to ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrder.cs index 3825139..1d6c856 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrder.cs @@ -12,7 +12,7 @@ namespace Win_in.Sfs.Scp.WebApi /// /// 采购订单主表 /// - public class PO: EntityBase + public class PurchaseOrder: EntityBase { /// /// 订单号(PoNumber) @@ -93,25 +93,25 @@ namespace Win_in.Sfs.Scp.WebApi public string Remark { set; get; } - public virtual List PODetails { get; set; } + public virtual List PODetails { get; set; } #region details handler - public virtual void AddDetail(IGuidGenerator guidGenerator, PODetail detail) + public virtual void AddDetail(IGuidGenerator guidGenerator, PurchaseOrderDetail detail) { Check.NotNull(guidGenerator, nameof(guidGenerator)); - Check.NotNull(detail, nameof(PODetail)); + Check.NotNull(detail, nameof(PurchaseOrderDetail)); if (IsInDetails(detail.PoNumber,detail.PoLine)) { throw new Exception(detail.PoNumber+ detail.PoLine + "已经在明细中存在!"); } - PODetails.Add(new PODetail(guidGenerator.Create(),detail.PoNumber, detail.PoLine, detail.PartCode, detail.Uom, detail.OrderQty, detail.StdPackQty, + PODetails.Add(new PurchaseOrderDetail(guidGenerator.Create(),detail.PoNumber, detail.PoLine, detail.PartCode, detail.Uom, detail.OrderQty, detail.StdPackQty, detail.SupplierPackConvertRate, detail.IsConsignment, detail.LineStatus, detail.Remark)); } - public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) + public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) { Check.NotNull(guidGenerator, nameof(guidGenerator)); foreach (var detail in details) @@ -132,9 +132,9 @@ namespace Win_in.Sfs.Scp.WebApi return PODetails.Any(di => di.Id == itemId); } - public virtual bool UpdateDetail(IGuidGenerator guidGenerator, PODetail detail) + public virtual bool UpdateDetail(IGuidGenerator guidGenerator, PurchaseOrderDetail detail) { - Check.NotNull(detail, nameof(PODetail)); + Check.NotNull(detail, nameof(PurchaseOrderDetail)); var item = FindDetail(detail.Id); @@ -144,7 +144,7 @@ namespace Win_in.Sfs.Scp.WebApi } else { - Check.NotNull(item, nameof(PODetail)); + Check.NotNull(item, nameof(PurchaseOrderDetail)); //item.Set(detail.Remark, detail.Enabled); @@ -152,7 +152,7 @@ namespace Win_in.Sfs.Scp.WebApi return true; } - public virtual PODetail FindDetail(Guid itemId) + public virtual PurchaseOrderDetail FindDetail(Guid itemId) { var item = PODetails.FirstOrDefault(p => p.Id == itemId); return item; diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PODetail.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrderDetail.cs similarity index 74% rename from ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PODetail.cs rename to ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrderDetail.cs index 0fd82a2..689616b 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PODetail.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrderDetail.cs @@ -8,7 +8,7 @@ namespace Win_in.Sfs.Scp.WebApi /// /// 采购订单明细 /// - public class PODetail: EntityDetailBase + public class PurchaseOrderDetail: EntityDetailBase { /// /// 订单号(PoNumber) @@ -40,18 +40,18 @@ namespace Win_in.Sfs.Scp.WebApi [Display(Name = "订单数量(OrderQty)")] public decimal? OrderQty { set; get; } - ///// - ///// 已关闭数量(Closed Qty) - ///// - //[Display(Name = "已关闭数量(Closed Qty)")] - //public decimal ClosedQty { get; set; } + /// + /// 已关闭数量(Closed Qty) + /// + [Display(Name = "已关闭数量(Closed Qty)")] + public decimal ClosedQty { get; set; } - ///// - ///// 标包计量单位(Standard Pack Uom) - ///// - //[Display(Name = "标包计量单位(Standard Pack Uom)")] - //public string StdPackUom { set; get; } + /// + /// 标包计量单位(Standard Pack Uom) + /// + [Display(Name = "标包计量单位(Standard Pack Uom)")] + public string StdPackUom { set; get; } /// /// 标包数量(Standard Pack Qty) @@ -59,17 +59,17 @@ namespace Win_in.Sfs.Scp.WebApi [Display(Name = "标包数量(Standard Pack Qty)")] public decimal? StdPackQty { set; get; } - ///// - ///// 供应商计量单位(SupplierPackUom) - ///// - //[Display(Name = "供应商计量单位(SupplierPackUom)")] - //public string SupplierPackUom { set; get; } + /// + /// 供应商计量单位(SupplierPackUom) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } - ///// - ///// 供应商包装数量(SupplierPackQty) - ///// - //[Display(Name = "供应商包装数量(SupplierPackQty)")] - //public decimal? SupplierPackQty { set; get; } + /// + /// 供应商包装数量(SupplierPackQty) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal? SupplierPackQty { set; get; } /// /// 供应商包装转换率(SupplierPackConvertRate) @@ -96,9 +96,9 @@ namespace Win_in.Sfs.Scp.WebApi public string Remark { set; get; } - public PODetail() { } + public PurchaseOrderDetail() { } - public PODetail( + public PurchaseOrderDetail( Guid id , string poNumber, string poLine,string partCode, string uom, decimal? orderQty, decimal? stdPackQty, decimal? supplierPackConvertRate, bool isConsignment,int lineStatus,string remark) :base(id) { diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs index 0480c0c..31fa6c1 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs @@ -2,7 +2,7 @@ { public static class WebApiSettings { - public const string GroupName = "WebApi"; + public const string GroupName = "ScpWebApi"; /* Add constants for setting names. Example: * public const string MySettingName = GroupName + ".MySettingName"; diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/IPORepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierRepository.cs similarity index 58% rename from ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/IPORepository.cs rename to ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierRepository.cs index 1266ba6..7793994 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/IPORepository.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierRepository.cs @@ -3,7 +3,7 @@ using Volo.Abp.Domain.Repositories; namespace Win_in.Sfs.Scp.WebApi { - public interface IPORepository : IRepository + public interface ISupplierRepository : IRepository { } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj index 9fa82a8..44ddc23 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj @@ -7,6 +7,18 @@ Win_in.Sfs.Scp.WebApi + + + + + + + + + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs index 6c030f1..8947d11 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs @@ -13,9 +13,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore DbSet Parts { get; set; } DbSet Suppliers { get; set; } - DbSet SupplierParts { get; set; } - DbSet POs { get; set; } - DbSet ASNs { get; set; } + DbSet PurchaseOrders { get; set; } DbSet Receipts { get; set; } } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/PartRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/PartRepository.cs new file mode 100644 index 0000000..07a3840 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/PartRepository.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; + +public class PartRepository:EfCoreRepository ,IPartRepository +{ + public PartRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/PurchaseOrderRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/PurchaseOrderRepository.cs new file mode 100644 index 0000000..af9785e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/PurchaseOrderRepository.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; + +public class PurchaseOrderRepository: EfCoreRepository, IPurchaseOrderRepository +{ + public PurchaseOrderRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/ReceiptRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/ReceiptRepository.cs new file mode 100644 index 0000000..3d49621 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/ReceiptRepository.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; + +public class ReceiptRepository: EfCoreRepository, IReceiptRepository +{ + public ReceiptRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/SupplierRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/SupplierRepository.cs new file mode 100644 index 0000000..f5de87b --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/SupplierRepository.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; + +public class SupplierRepository: EfCoreRepository, ISupplierRepository +{ + public SupplierRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs index 0d39a53..407898f 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs @@ -14,9 +14,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore public virtual DbSet Parts { get; set; } public virtual DbSet Suppliers { get; set; } - public virtual DbSet SupplierParts { get; set; } - public virtual DbSet POs { get; set; } - public virtual DbSet ASNs { get; set; } + public virtual DbSet PurchaseOrders { get; set; } public virtual DbSet Receipts { get; set; } public WebApiDbContext(DbContextOptions options) diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs index 0718736..b6f8251 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs @@ -43,13 +43,9 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore builder.ConfigurePart(options); builder.ConfigSuppliers(options); - builder.ConfigSupplierPart(options); builder.ConfigReceipt(options); - builder.ConfigPO(options); - builder.ConfigPODetail(options); - builder.ConfigASN(options); - builder.ConfigASNDetail(options); - builder.ConfigLabel(options); + builder.ConfigPurchaseOrder(options); + builder.ConfigPurchaseOrderDetail(options); } /// @@ -82,8 +78,6 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore //b.Property(x => x.Color).HasMaxLength(64); //b.Property(x => x.Configuration).HasMaxLength(64); //b.Property(x => x.Project).HasMaxLength(64); - b.Property(x => x.Version).HasMaxLength(64); - b.Property(x => x.SequenceNumber).HasMaxLength(64); //b.Property(x => x.Eco).HasMaxLength(64); //b.Property(x => x.StdPackUom).IsRequired().HasMaxLength(64); //b.Property(x => x.StdPackQty).IsRequired(); @@ -125,13 +119,12 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore b.Property(q => q.Company).HasMaxLength(64); b.Property(q => q.Remark).HasMaxLength(4096); b.Property(x => x.Bank).HasMaxLength(64); - b.Property(x => x.Version).HasMaxLength(64); - b.Property(x => x.SequenceNumber).HasMaxLength(64); b.HasIndex(q => new {q.Code, q.Company}).IsUnique(); }); } + /* /// /// 供应商零件 /// @@ -156,6 +149,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore b.HasIndex(x => new { x.SupplierCode,x.PartCode,x.Company,x.Site }).IsUnique(); }); } + */ /// /// 收货单与退货单明细 @@ -197,8 +191,6 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore //b.Property(q => q.SupplierPackQty).IsRequired(); b.Property(q => q.SupplierPackConvertRate).IsRequired(); b.Property(q => q.Remark).HasMaxLength(4096); - b.Property(x => x.Version).HasMaxLength(64); - b.Property(x => x.SequenceNumber).HasMaxLength(64); b.HasIndex(x => new { x.RcNumber,x.PoLine,x.PartCode,x.Company,x.Site }).IsUnique(); }); @@ -207,9 +199,9 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore /// /// 采购订单主表 /// - private static void ConfigPO(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + private static void ConfigPurchaseOrder(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) { - builder.Entity(b => + builder.Entity(b => { //Configure table & schema name b.ToTable(options.TablePrefix + "_PO", options.Schema); @@ -223,15 +215,12 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore b.Property(q => q.IsConsignment).IsRequired(); b.Property(q => q.OrderDate).IsRequired(); b.Property(q => q.DueDate).IsRequired(); - b.Property(q => q.Version).IsRequired().HasMaxLength(64); b.Property(q => q.TaxRate).IsRequired(); b.Property(q => q.Site).IsRequired().HasMaxLength(64); b.Property(q => q.Company).IsRequired().HasMaxLength(64); b.Property(q => q.ContactName).HasMaxLength(64); b.Property(q => q.ContactPhone).HasMaxLength(64); b.Property(q => q.Remark).HasMaxLength(4096); - b.Property(x => x.Version).HasMaxLength(64); - b.Property(x => x.SequenceNumber).HasMaxLength(64); b.HasMany(u => u.PODetails).WithOne().HasForeignKey(rd => rd.Id).OnDelete(DeleteBehavior.NoAction).IsRequired(); @@ -243,9 +232,9 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore /// /// 采购订单明细表 /// - private static void ConfigPODetail(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + private static void ConfigPurchaseOrderDetail(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) { - builder.Entity(b => + builder.Entity(b => { //Configure table & schema name b.ToTable(options.TablePrefix + "_PODetail", options.Schema); @@ -265,13 +254,13 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore b.Property(q => q.IsConsignment).IsRequired(); b.Property(q => q.LineStatus).IsRequired(); b.Property(q => q.Remark).HasMaxLength(4096); - b.Property(x => x.Version).HasMaxLength(64); b.HasIndex(x => new { x.PoNumber,x.PoLine }).IsUnique(); }); } + /* /// /// 发货单主表 /// @@ -383,6 +372,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore b.HasIndex(x => new { x.LabelCode,x.Company,x.Site }).IsUnique(); }); } + */ } } \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs index 1aa151c..a70de53 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs @@ -17,6 +17,11 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore /* Add custom repositories here. Example: * options.AddRepository(); */ + + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); }); } } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs index e4399b9..96859a5 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs @@ -30,6 +30,12 @@ namespace Win_in.Sfs.Scp.WebApi .AddBaseTypes(typeof(AbpUiResource)); }); + Configure(options => + { + options + .ConventionalControllers + .Create(typeof(WebApiApplicationModule).Assembly); + }); } } diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj index 88699f4..17ab13b 100644 --- a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj @@ -14,6 +14,7 @@ +