From 0d45683ff28b337e2c1334a7c468193cb0aaf8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E8=8D=A3=E5=9B=BD?= Date: Tue, 11 Jan 2022 09:42:33 +0800 Subject: [PATCH] =?UTF-8?q?[add]=20=E6=B7=BB=E5=8A=A0=E5=BD=93=E5=89=8DSCP?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E4=BD=93=E5=92=8C=E4=BB=93=E5=82=A8=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SCP/Class1.cs | 425 ------------------ .../Win_in.Sfs.Scp.WebApi.Domain.csproj | 4 - .../src/Win_in.Sfs.Scp.v1.Domain/Class1.cs | 8 - .../Parts/IPartRepository.cs | 9 + .../Win_in.Sfs.Scp.v1.Domain/Parts/TA_PART.cs | 74 +++ .../IPurchaseOrderRepository.cs | 9 + .../PurchaseOrders/TB_PO.cs | 61 +++ .../PurchaseOrders/TB_PO_DETAIL.cs | 89 ++++ .../Receipts/IReceiptRepository.cs | 9 + .../Receipts/TB_RECEIVE_DETAIL_QAD.cs | 75 ++++ .../Receipts/TB_RECEIVE_QAD.cs | 56 +++ .../Win_in.Sfs.Scp.v1.Domain/RecordEntity.cs | 14 + .../Rejects/IReceiptRepository.cs | 9 + .../Rejects/TB_REJECT.cs | 40 ++ .../Rejects/TB_REJECT_DETAIL.cs | 31 ++ .../Suppliers/ISupplierRepository.cs | 9 + .../Suppliers/TA_VENDER.cs | 75 ++++ .../V1ScpDomainModule.cs | 14 + .../src/Win_in.Sfs.Scp.v1.Domain/VConsts.cs | 11 + .../Win_in.Sfs.Scp.v1.Domain.csproj | 5 + .../Class1.cs | 8 - .../IV1ScpDbContext.cs | 14 + .../PartRepository.cs | 14 + .../PurchaseOrderRepository.cs | 13 + .../ReceiptRepository.cs | 13 + .../RejectRepository.cs | 13 + .../SupplierRepository.cs | 13 + .../V1ScpDbContext.cs | 48 ++ .../V1ScpDbContextModelCreatingExtensions.cs | 230 ++++++++++ .../V1ScpEntityFrameworkCoreModule.cs | 60 +++ .../V1ScpModelBuilderConfigurationOptions.cs | 18 + ...n_in.Sfs.Scp.v1.EntityFrameworkCore.csproj | 11 +- 32 files changed, 1036 insertions(+), 446 deletions(-) delete mode 100644 WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SCP/Class1.cs delete mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Class1.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/IPartRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/TA_PART.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/IPurchaseOrderRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO_DETAIL.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/IReceiptRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_DETAIL_QAD.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_QAD.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/RecordEntity.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/IReceiptRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT_DETAIL.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/ISupplierRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/TA_VENDER.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/V1ScpDomainModule.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.Domain/VConsts.cs delete mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Class1.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/IV1ScpDbContext.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PartRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PurchaseOrderRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/ReceiptRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/RejectRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/SupplierRepository.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContext.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContextModelCreatingExtensions.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpEntityFrameworkCoreModule.cs create mode 100644 WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpModelBuilderConfigurationOptions.cs diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SCP/Class1.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SCP/Class1.cs deleted file mode 100644 index a65b097..0000000 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SCP/Class1.cs +++ /dev/null @@ -1,425 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Win_in.Sfs.Scp.WebApi.SCP; - -public class TA_PART -{ - - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long UID { get; set; } - - [Key] - [Column(Order = 0)] - [StringLength(50)] - public string PartCode { get; set; } - - [Required] - [StringLength(50)] - public string ErpPartCode { get; set; } - - // [Required] - public string PartDesc1 { get; set; } - - // [Required] - public string PartDesc2 { get; set; } - - // [Required] - [StringLength(50)] - public string ProjectId { get; set; } - - [Required] - [StringLength(50)] - public string Unit { get; set; } - - // [Required] - [StringLength(50)] - public string PartGroup { get; set; } - - [Required] - [StringLength(10)] - public string State { get; set; } - - [StringLength(100)] - public string Configuration { get; set; } - - public int ValidityDays { get; set; } - - [StringLength(50)] - public string ReceivePort { get; set; } - - [StringLength(50)] - public string PalletSize { get; set; } - - [StringLength(500)] - public string Remark { get; set; } - [Key] - [Column(Order = 1)] - [StringLength(50)] - public string Site { get; set; } - - - public string Qlevel { get; set; } - - public bool? Ischeck { get; set; } - - -} - -public class TA_VENDER -{ - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public int UID { get; set; } - - [Key] - [Column(Order = 0)] - [StringLength(50)] - public string VendId { get; set; } - - [Required] - [StringLength(50)] - public string VendName { get; set; } - - [Required] - [StringLength(50)] - public string VendAbbCode { get; set; } - - [StringLength(50)] - public string VendType { get; set; } - - [StringLength(50)] - public string Country { get; set; } - - [StringLength(50)] - public string City { get; set; } - - [StringLength(50)] - public string Currency { get; set; } - - [StringLength(200)] - public string Address { get; set; } - - [StringLength(50)] - public string ZipCode { get; set; } - - [StringLength(50)] - public string Contacter { get; set; } - - [StringLength(50)] - public string Phone { get; set; } - - [StringLength(50)] - public string Fax { get; set; } - - [StringLength(50)] - public string Email { get; set; } - - public int State { get; set; } - - [StringLength(500)] - public string Remark { get; set; } - - - public decimal? Tax { get; set; } - [Key] - [Column(Order = 1)] - [StringLength(50)] - public string Site { get; set; } - - public int? ReceiveTimeScope { set; get; } - public decimal? Quota { set; get; } - -} - -public class TB_PO : RecordEntity -{ - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long UID { get; set; } - [Key] - [Column(Order = 0)] - [StringLength(50)] - public string PoBillNum { get; set; } - [StringLength(50)] - public string ErpBillNum { get; set; } - [StringLength(50)] - public string VendId { get; set; } - public int? ModType { get; set; } - [StringLength(50)] - public string Contacter { get; set; } - [Key] - [Column(Order = 1)] - [StringLength(50)] - public string Site { get; set; } - [StringLength(50)] - public string Buyer { get; set; } - [StringLength(50)] - public string BuyerPhone { get; set; } - public int State { get; set; } - [StringLength(200)] - public string Remark { get; set; } - - public DateTime? BeginTime { get; set; } - - public DateTime? EndTime { get; set; } - - - public string Extend1 { get; set; } - public string Extend2 { get; set; } - public string Extend3 { get; set; } - public string SubSite { get; set; } - -} - -public class TB_PO_DETAIL : RecordEntity -{ - - - - - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long UID { get; set; } - - - - [StringLength(50)] - public string PoBillNum { get; set; } - public int PoLine { get; set; } - - public Nullable BeginTime { get; set; } - public Nullable EndTime { get; set; } - - [Required] - [StringLength(50)] - public string PartCode { get; set; } - - [Column(TypeName = "money")] - public decimal ShippedQty { get; set; } - - [Column(TypeName = "money")] - public decimal ReceivedQty { get; set; } - - public string RejectQty { get; set; } - - [StringLength(50)] - public string PoUnit { get; set; } - - [StringLength(50)] - public string LocUnit { get; set; } - - [Column(TypeName = "money")] - public decimal Price { get; set; } - - [StringLength(50)] - public string Currency { get; set; } - - public decimal PlanQty { get; set; } - [Column(TypeName = "money")] - public decimal PackQty { get; set; } - [Column(TypeName = "money")] - public decimal? TempQty { get; set; } - - public int State { get; set; } - - [StringLength(200)] - public string Remark { get; set; } - public decimal UnConv { get; set; } - [StringLength(50)] - public string DockCode { get; set; } - - public string Extend1 { get; set; } - public string Extend2 { get; set; } - public string Extend3 { get; set; } - public string SubSite { get; set; } - - public string Site { get; set; } - -} - -public class TB_RECEIVE_QAD -{ - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long UID { get; set; } - [StringLength(50)] - - public string RecvBillNum { get; set; } - [StringLength(50)] - public string PoBillNum { get; set; } - [StringLength(50)] - public string AsnBillNum { get; set; } - - [Key] - [Column(Order = 1)] - [StringLength(50)] - public string Site { get; set; } - [StringLength(50)] - public string VendId { get; set; } - public DateTime ShipTime { get; set; } - public int State { get; set; } - [StringLength(50)] - public string Remark { get; set; } - public DateTime CreateTime { get; set; } - [StringLength(50)] - public string CreateUser { get; set; } - public bool IsDeleted { get; set; } - public Guid GUID { get; set; } - [StringLength(50)] - public string OperName { get; set; } - public int BillType { get; set; } - [Key] - [Column(Order = 0)] - public string ErpRecvBillNum { get; set; } - - - public string Tax { get; set; } - public string Extend1 { get; set; } - public string Extend2 { get; set; } - public string Extend3 { get; set; } - - public string SubSite { get; set; } - - - -} - -public class TB_RECEIVE_DETAIL_QAD -{ - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long UID { get; set; } - [StringLength(50)] - - public string RecvBillNum { get; set; } - //[Key] - //[Column(Order = 1)] - //[StringLength(50)] - public string PoBillNum { get; set; } - //[Key] - //[Column(Order = 2)] - public int PoLine { get; set; } - [Key] - [Column(Order = 3)] - [StringLength(50)] - public string PartCode { get; set; } - [StringLength(50)] - public string Batch { get; set; } - public decimal Qty { get; set; } - [StringLength(50)] - public string DockCode { get; set; } - public int State { get; set; } - [StringLength(500)] - public string Remark { get; set; } - public DateTime CreateTime { get; set; } - [StringLength(50)] - public string CreateUser { get; set; } - public bool IsDeleted { get; set; } - - public Guid GUID { get; set; } - - public int BillType { get; set; } - [StringLength(50)] - public string VendBatch { get; set; } - [StringLength(50)] - public string PoUnit { get; set; } - [StringLength(50)] - public string LocUnit { get; set; } - [Key] - [Column(Order = 0)] - public string ErpRecvBillNum { get; set; } - - /// - /// 采购价 - /// - public decimal? PurCost { get; set; } - /// - /// 成本价 - /// - public decimal? StdCost { get; set; } - [Key] - [Column(Order = 4)] - public string Site { get; set; } - - public decimal? Rate { get; set; } - - - public decimal? CurAmt { get; set; } - - public string Tax { get; set; } - public string Extend1 { get; set; } - public string Extend2 { get; set; } - public string Extend3 { get; set; } - - public string SubSite { get; set; } -} - -public class TB_REJECT -{ - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Key] - public long UID { get; set; } - [StringLength(50)] - public string RjctBillNum { get; set; } - [StringLength(50)] - public string PoBillNum { get; set; } - [StringLength(50)] - public string AsnBillNum { get; set; } - [StringLength(50)] - public string Site { get; set; } - [StringLength(50)] - public string VendId { get; set; } - public DateTime ShipTime { get; set; } - public int State { get; set; } - [StringLength(50)] - public string Remark { get; set; } - public DateTime CreateTime { get; set; } - [StringLength(50)] - public string CreateUser { get; set; } - public bool IsDeleted { get; set; } - public Guid GUID { get; set; } - [StringLength(50)] - public string OperName { get; set; } -} - -public class TB_REJECT_DETAIL -{ - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Key] - public long UID { get; set; } - [StringLength(50)] - public string RjctBillNum { get; set; } - [StringLength(50)] - public string PoBillNum { get; set; } - public int PoLine { get; set; } - [StringLength(50)] - public string PartCode { get; set; } - [StringLength(50)] - public string Batch { get; set; } - public decimal Qty { get; set; } - public int State { get; set; } - [StringLength(50)] - public string Remark { get; set; } - public DateTime CreateTime { get; set; } - [StringLength(50)] - public string CreateUser { get; set; } - public bool IsDeleted { get; set; } - public Guid GUID { get; set; } -} - -[Serializable] -public class RecordEntity -{ - public DateTime CreateTime { get; set; } - - [StringLength(50)] - public string CreateUser { get; set; } - public DateTime? UpdateTime { get; set; } - [StringLength(50)] - public string UpdateUser { get; set; } - [StringLength(50)] - public string UpdateInfo { get; set; } - public bool IsDeleted { get; set; } - public Guid GUID { get; set; } - - -} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj index a66ed90..ea8ee01 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj @@ -24,8 +24,4 @@ - - - - diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Class1.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Class1.cs deleted file mode 100644 index b303073..0000000 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Class1.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Win_in.Sfs.Scp.v1.Domain -{ - public class Class1 - { - } -} diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/IPartRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/IPartRepository.cs new file mode 100644 index 0000000..d517f01 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/IPartRepository.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public interface IPartRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/TA_PART.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/TA_PART.cs new file mode 100644 index 0000000..22e1020 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/TA_PART.cs @@ -0,0 +1,74 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Domain.Entities; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TA_PART:Entity + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + + [Key] + [Column(Order = 0)] + [StringLength(50)] + public string PartCode { get; set; } + + [Required] + [StringLength(50)] + public string ErpPartCode { get; set; } + + // [Required] + public string PartDesc1 { get; set; } + + // [Required] + public string PartDesc2 { get; set; } + + // [Required] + [StringLength(50)] + public string ProjectId { get; set; } + + [Required] + [StringLength(50)] + public string Unit { get; set; } + + // [Required] + [StringLength(50)] + public string PartGroup { get; set; } + + [Required] + [StringLength(10)] + public string State { get; set; } + + [StringLength(100)] + public string Configuration { get; set; } + + public int ValidityDays { get; set; } + + [StringLength(50)] + public string ReceivePort { get; set; } + + [StringLength(50)] + public string PalletSize { get; set; } + + [StringLength(500)] + public string Remark { get; set; } + + [Key] + [Column(Order = 1)] + [StringLength(50)] + public string Site { get; set; } + + + public string Qlevel { get; set; } + + public bool? Ischeck { get; set; } + + + public override object[] GetKeys() + { + return new object[]{Site,PartCode}; + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/IPurchaseOrderRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/IPurchaseOrderRepository.cs new file mode 100644 index 0000000..d113170 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/IPurchaseOrderRepository.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public interface IPurchaseOrderRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO.cs new file mode 100644 index 0000000..ea95fc8 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO.cs @@ -0,0 +1,61 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Domain.Entities; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TB_PO : Entity + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + [Key] + [Column(Order = 0)] + [StringLength(50)] + public string PoBillNum { get; set; } + [StringLength(50)] + public string ErpBillNum { get; set; } + [StringLength(50)] + public string VendId { get; set; } + public int? ModType { get; set; } + [StringLength(50)] + public string Contacter { get; set; } + [Key] + [Column(Order = 1)] + [StringLength(50)] + public string Site { get; set; } + [StringLength(50)] + public string Buyer { get; set; } + [StringLength(50)] + public string BuyerPhone { get; set; } + public int State { get; set; } + [StringLength(200)] + public string Remark { get; set; } + + public DateTime? BeginTime { get; set; } + + public DateTime? EndTime { get; set; } + + + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + public string SubSite { get; set; } + + public DateTime CreateTime { get; set; } + [StringLength(50)] + public string CreateUser { get; set; } + public DateTime? UpdateTime { get; set; } + [StringLength(50)] + public string UpdateUser { get; set; } + [StringLength(50)] + public string UpdateInfo { get; set; } + public bool IsDeleted { get; set; } + public Guid GUID { get; set; } + + public override object[] GetKeys() + { + return new object[] { Site, PoBillNum }; + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO_DETAIL.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO_DETAIL.cs new file mode 100644 index 0000000..d10561f --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/TB_PO_DETAIL.cs @@ -0,0 +1,89 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Domain.Entities; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TB_PO_DETAIL : Entity + { + + + + + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + + + + [StringLength(50)] + public string PoBillNum { get; set; } + public int PoLine { get; set; } + + public DateTime? BeginTime { get; set; } + public DateTime? EndTime { get; set; } + + [Required] + [StringLength(50)] + public string PartCode { get; set; } + + [Column(TypeName = "money")] + public decimal ShippedQty { get; set; } + + [Column(TypeName = "money")] + public decimal ReceivedQty { get; set; } + + public string RejectQty { get; set; } + + [StringLength(50)] + public string PoUnit { get; set; } + + [StringLength(50)] + public string LocUnit { get; set; } + + [Column(TypeName = "money")] + public decimal Price { get; set; } + + [StringLength(50)] + public string Currency { get; set; } + + public decimal PlanQty { get; set; } + [Column(TypeName = "money")] + public decimal PackQty { get; set; } + [Column(TypeName = "money")] + public decimal? TempQty { get; set; } + + public int State { get; set; } + + [StringLength(200)] + public string Remark { get; set; } + public decimal UnConv { get; set; } + [StringLength(50)] + public string DockCode { get; set; } + + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + public string SubSite { get; set; } + + public string Site { get; set; } + + public DateTime CreateTime { get; set; } + [StringLength(50)] + public string CreateUser { get; set; } + public DateTime? UpdateTime { get; set; } + [StringLength(50)] + public string UpdateUser { get; set; } + [StringLength(50)] + public string UpdateInfo { get; set; } + public bool IsDeleted { get; set; } + public Guid GUID { get; set; } + + + public override object[] GetKeys() + { + return new object[] { UID }; + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/IReceiptRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/IReceiptRepository.cs new file mode 100644 index 0000000..d33def9 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/IReceiptRepository.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public interface IReceiptRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_DETAIL_QAD.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_DETAIL_QAD.cs new file mode 100644 index 0000000..6c5b707 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_DETAIL_QAD.cs @@ -0,0 +1,75 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TB_RECEIVE_DETAIL_QAD + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + [StringLength(50)] + + public string RecvBillNum { get; set; } + //[Key] + //[Column(Order = 1)] + //[StringLength(50)] + public string PoBillNum { get; set; } + //[Key] + //[Column(Order = 2)] + public int PoLine { get; set; } + [Key] + [Column(Order = 3)] + [StringLength(50)] + public string PartCode { get; set; } + [StringLength(50)] + public string Batch { get; set; } + public decimal Qty { get; set; } + [StringLength(50)] + public string DockCode { get; set; } + public int State { get; set; } + [StringLength(500)] + public string Remark { get; set; } + public DateTime CreateTime { get; set; } + [StringLength(50)] + public string CreateUser { get; set; } + public bool IsDeleted { get; set; } + + public Guid GUID { get; set; } + + public int BillType { get; set; } + [StringLength(50)] + public string VendBatch { get; set; } + [StringLength(50)] + public string PoUnit { get; set; } + [StringLength(50)] + public string LocUnit { get; set; } + [Key] + [Column(Order = 0)] + public string ErpRecvBillNum { get; set; } + + /// + /// 采购价 + /// + public decimal? PurCost { get; set; } + /// + /// 成本价 + /// + public decimal? StdCost { get; set; } + [Key] + [Column(Order = 4)] + public string Site { get; set; } + + public decimal? Rate { get; set; } + + + public decimal? CurAmt { get; set; } + + public string Tax { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_QAD.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_QAD.cs new file mode 100644 index 0000000..1bebdff --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/TB_RECEIVE_QAD.cs @@ -0,0 +1,56 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Domain.Entities; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TB_RECEIVE_QAD:Entity + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + [StringLength(50)] + + public string RecvBillNum { get; set; } + [StringLength(50)] + public string PoBillNum { get; set; } + [StringLength(50)] + public string AsnBillNum { get; set; } + + [Key] + [Column(Order = 1)] + [StringLength(50)] + public string Site { get; set; } + [StringLength(50)] + public string VendId { get; set; } + public DateTime ShipTime { get; set; } + public int State { get; set; } + [StringLength(50)] + public string Remark { get; set; } + public DateTime CreateTime { get; set; } + [StringLength(50)] + public string CreateUser { get; set; } + public bool IsDeleted { get; set; } + public Guid GUID { get; set; } + [StringLength(50)] + public string OperName { get; set; } + public int BillType { get; set; } + [Key] + [Column(Order = 0)] + public string ErpRecvBillNum { get; set; } + + + public string Tax { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } + + + public override object[] GetKeys() + { + return new object[] { Site,ErpRecvBillNum }; + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/RecordEntity.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/RecordEntity.cs new file mode 100644 index 0000000..b3e3971 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/RecordEntity.cs @@ -0,0 +1,14 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + [Serializable] + public class RecordEntity + { + + + + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/IReceiptRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/IReceiptRepository.cs new file mode 100644 index 0000000..5de16eb --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/IReceiptRepository.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public interface IRejectRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT.cs new file mode 100644 index 0000000..9d85e93 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT.cs @@ -0,0 +1,40 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Domain.Entities; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TB_REJECT:Entity + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + [StringLength(50)] + public string RjctBillNum { get; set; } + [StringLength(50)] + public string PoBillNum { get; set; } + [StringLength(50)] + public string AsnBillNum { get; set; } + [StringLength(50)] + public string Site { get; set; } + [StringLength(50)] + public string VendId { get; set; } + public DateTime ShipTime { get; set; } + public int State { get; set; } + [StringLength(50)] + public string Remark { get; set; } + public DateTime CreateTime { get; set; } + [StringLength(50)] + public string CreateUser { get; set; } + public bool IsDeleted { get; set; } + public Guid GUID { get; set; } + [StringLength(50)] + public string OperName { get; set; } + + public override object[] GetKeys() + { + return new object[] { UID }; + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT_DETAIL.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT_DETAIL.cs new file mode 100644 index 0000000..db51655 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/TB_REJECT_DETAIL.cs @@ -0,0 +1,31 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TB_REJECT_DETAIL + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + [StringLength(50)] + public string RjctBillNum { get; set; } + [StringLength(50)] + public string PoBillNum { get; set; } + public int PoLine { get; set; } + [StringLength(50)] + public string PartCode { get; set; } + [StringLength(50)] + public string Batch { get; set; } + public decimal Qty { get; set; } + public int State { get; set; } + [StringLength(50)] + public string Remark { get; set; } + public DateTime CreateTime { get; set; } + [StringLength(50)] + public string CreateUser { get; set; } + public bool IsDeleted { get; set; } + public Guid GUID { get; set; } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/ISupplierRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/ISupplierRepository.cs new file mode 100644 index 0000000..b93534b --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/ISupplierRepository.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public interface ISupplierRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/TA_VENDER.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/TA_VENDER.cs new file mode 100644 index 0000000..8a1d1bb --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/TA_VENDER.cs @@ -0,0 +1,75 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Domain.Entities; + +namespace Win_in.Sfs.Scp.v1.Domain +{ + public class TA_VENDER:Entity + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int UID { get; set; } + + [Key] + [Column(Order = 0)] + [StringLength(50)] + public string VendId { get; set; } + + [Required] + [StringLength(50)] + public string VendName { get; set; } + + [Required] + [StringLength(50)] + public string VendAbbCode { get; set; } + + [StringLength(50)] + public string VendType { get; set; } + + [StringLength(50)] + public string Country { get; set; } + + [StringLength(50)] + public string City { get; set; } + + [StringLength(50)] + public string Currency { get; set; } + + [StringLength(200)] + public string Address { get; set; } + + [StringLength(50)] + public string ZipCode { get; set; } + + [StringLength(50)] + public string Contacter { get; set; } + + [StringLength(50)] + public string Phone { get; set; } + + [StringLength(50)] + public string Fax { get; set; } + + [StringLength(50)] + public string Email { get; set; } + + public int State { get; set; } + + [StringLength(500)] + public string Remark { get; set; } + + + public decimal? Tax { get; set; } + [Key] + [Column(Order = 1)] + [StringLength(50)] + public string Site { get; set; } + + public int? ReceiveTimeScope { set; get; } + public decimal? Quota { set; get; } + + public override object[] GetKeys() + { + return new object[] { Site, VendId }; + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/V1ScpDomainModule.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/V1ScpDomainModule.cs new file mode 100644 index 0000000..a89a3ed --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/V1ScpDomainModule.cs @@ -0,0 +1,14 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn()] + public class V1ScpDomainModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + } + } +} diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/VConsts.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/VConsts.cs new file mode 100644 index 0000000..08eb98d --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/VConsts.cs @@ -0,0 +1,11 @@ +namespace Win_in.Sfs.Scp.WebApi +{ + public static class V1ScpConsts + { + public static string DbTablePrefix { get; set; } = ""; + + public static string DbSchema { get; set; } = null; + + public const string ConnectionStringName = "V1Scp"; + } +} diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Win_in.Sfs.Scp.v1.Domain.csproj b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Win_in.Sfs.Scp.v1.Domain.csproj index f208d30..d0d3177 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Win_in.Sfs.Scp.v1.Domain.csproj +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Win_in.Sfs.Scp.v1.Domain.csproj @@ -4,4 +4,9 @@ net5.0 + + + + + diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Class1.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Class1.cs deleted file mode 100644 index c4f5fd0..0000000 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Class1.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore -{ - public class Class1 - { - } -} diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/IV1ScpDbContext.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/IV1ScpDbContext.cs new file mode 100644 index 0000000..85d3a5c --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/IV1ScpDbContext.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; +using Win_in.Sfs.Scp.v1.Domain; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public interface IV1ScpDbContext + { + DbSet Parts { get; set; } + DbSet Suppliers { get; set; } + DbSet PurchaseOrders { get; set; } + DbSet Receipts { get; set; } + DbSet Rejects { get; set; } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PartRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PartRepository.cs new file mode 100644 index 0000000..988310f --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PartRepository.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.v1.Domain; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + + public class PartRepository : EfCoreRepository, IPartRepository + { + public PartRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PurchaseOrderRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PurchaseOrderRepository.cs new file mode 100644 index 0000000..a06656f --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PurchaseOrderRepository.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.v1.Domain; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public class PurchaseOrderRepository : EfCoreRepository, IPurchaseOrderRepository + { + public PurchaseOrderRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/ReceiptRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/ReceiptRepository.cs new file mode 100644 index 0000000..4155bf5 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/ReceiptRepository.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.v1.Domain; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public class ReceiptRepository : EfCoreRepository, IReceiptRepository + { + public ReceiptRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/RejectRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/RejectRepository.cs new file mode 100644 index 0000000..f7f624e --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/RejectRepository.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.v1.Domain; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public class RejectRepository : EfCoreRepository, IRejectRepository + { + public RejectRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/SupplierRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/SupplierRepository.cs new file mode 100644 index 0000000..ccd9939 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/SupplierRepository.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.v1.Domain; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public class SupplierRepository : EfCoreRepository, ISupplierRepository + { + public SupplierRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContext.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContext.cs new file mode 100644 index 0000000..1bc3a0a --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContext.cs @@ -0,0 +1,48 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.v1.Domain; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public class V1ScpDbContext : + AbpDbContext, + IV1ScpDbContext + + { + /* Add DbSet properties for your Aggregate Roots / Entities here. */ + + + public virtual DbSet Parts { get; set; } + public virtual DbSet Suppliers { get; set; } + public virtual DbSet PurchaseOrders { get; set; } + public virtual DbSet Receipts { get; set; } + public virtual DbSet Rejects { get; set; } + + + + + public V1ScpDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + /* Configure your own tables/entities inside here */ + + //builder.Entity(b => + //{ + // b.ToTable(WebApiConsts.DbTablePrefix + "YourEntities", WebApiConsts.DbSchema); + // b.ConfigureByConvention(); //auto configure for the base class props + // //... + //}); + + builder.ConfigureWebApi(); + } + } + + +} diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContextModelCreatingExtensions.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContextModelCreatingExtensions.cs new file mode 100644 index 0000000..028dd62 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContextModelCreatingExtensions.cs @@ -0,0 +1,230 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; +using Win_in.Sfs.Scp.WebApi; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public static class V1ScpDbContextModelCreatingExtensions + { + public const string IsDeletedFilter = "IsDeleted=0"; + public static void ConfigureWebApi( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new V1ScpModelBuilderConfigurationOptions( + V1ScpConsts.DbTablePrefix, + V1ScpConsts.DbSchema + ); + + optionsAction?.Invoke(options); + + /* + builder.ConfigurePart(options); + builder.ConfigSuppliers(options); + builder.ConfigReceipt(options); + builder.ConfigPurchaseOrder(options); + builder.ConfigPurchaseOrderDetail(options); + builder.ConfigUnplannedReceipt(options); + */ + } + + /* + /// + /// 零件表 + /// + /// + /// + private static void ConfigurePart(this ModelBuilder builder, V1ScpModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + + b.ToTable($"{options.TablePrefix}_Part", options.Schema); + + b.ConfigureByConvention(); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Desc1).HasMaxLength(1024); + b.Property(x => x.Desc2).HasMaxLength(1024); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + b.Property(x => x.IsBuyPart).IsRequired(); + b.Property(x => x.IsMakePart).IsRequired(); + b.Property(x => x.Uom).IsRequired().HasMaxLength(64); + b.Property(x => x.AbcClass).IsRequired().HasMaxLength(64); + b.Property(x => x.ProductLine).HasMaxLength(64); + b.Property(x => x.Type).HasMaxLength(64); + b.Property(x => x.Catalog).HasMaxLength(64); + b.Property(x => x.Group).HasMaxLength(64); + b.Property(x => x.Version).HasMaxLength(64); + b.Property(x => x.Site).IsRequired().HasMaxLength(64); + b.Property(x => x.Company).IsRequired().HasMaxLength(64); + //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.Eco).HasMaxLength(64); + //b.Property(x => x.StdPackUom).IsRequired().HasMaxLength(64); + //b.Property(x => x.StdPackQty).IsRequired(); + //b.Property(x => x.ExtPackUom).HasMaxLength(64); + //b.Property(x => x.ExtPackQty); + }); + } + + + /// + /// 供应商 + /// + private static void ConfigSuppliers(this ModelBuilder builder, V1ScpModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_Suppliers", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.Code).IsRequired().HasMaxLength(64); + b.Property(q => q.Name).IsRequired().HasMaxLength(64); + b.Property(q => q.Desc).HasMaxLength(1024); + b.Property(q => q.Rank).HasMaxLength(64); + b.Property(q => q.Address).HasMaxLength(1024); + b.Property(q => q.Country).HasMaxLength(64); + b.Property(q => q.City).HasMaxLength(64); + b.Property(q => q.Phone).HasMaxLength(64); + b.Property(q => q.Fax).HasMaxLength(64); + b.Property(q => q.PostId).HasMaxLength(64); + b.Property(q => q.ContactName).HasMaxLength(64); + b.Property(q => q.Currency).HasMaxLength(64); + b.Property(q => q.IsActive).IsRequired(); + b.Property(q => q.Company).HasMaxLength(64); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(x => x.Bank).HasMaxLength(64); + }); + } + + /// + /// 收货单与退货单明细 + /// + private static void ConfigReceipt(this ModelBuilder builder, V1ScpModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_Receipt", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.RcNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.AsnNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.PoNumber).HasMaxLength(64); + b.Property(q => q.SupplierCode).IsRequired().HasMaxLength(64); + b.Property(q => q.RcType).IsRequired().HasMaxLength(64); + b.Property(q => q.Warehouse).HasMaxLength(64); + b.Property(q => q.Dock).HasMaxLength(64); + b.Property(q => q.ReceiveDate).IsRequired(); + b.Property(q => q.ReceiveTime); + b.Property(q => q.PoLine).HasMaxLength(64); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); + b.Property(q => q.Lot).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierLot).IsRequired(); + b.Property(q => q.Uom).IsRequired().HasMaxLength(64); + b.Property(q => q.ReceiveQty).IsRequired(); + b.Property(q => q.SupplierPackConvertRate).IsRequired(); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(q => q.Site).IsRequired().HasMaxLength(64); + b.Property(q => q.Company).IsRequired().HasMaxLength(64); + }); + } + + /// + /// 采购订单主表 + /// + private static void ConfigPurchaseOrder(this ModelBuilder builder, V1ScpModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_PO", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.PoNumber).HasMaxLength(64); + b.Property(q => q.SupplierCode).IsRequired().HasMaxLength(64); + b.Property(q => q.PoType).IsRequired().HasMaxLength(64); + b.Property(q => q.Status).IsRequired(); + 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.HasMany(u => u.Details).WithOne().HasForeignKey(rd => rd.Id).OnDelete(DeleteBehavior.NoAction).IsRequired(); + + }); + } + + /// + /// 采购订单明细表 + /// + private static void ConfigPurchaseOrderDetail(this ModelBuilder builder, V1ScpModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_PODetail", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.PoNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.PoLine).IsRequired().HasMaxLength(64); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); + b.Property(q => q.Uom).IsRequired().HasMaxLength(64); + b.Property(q => q.OrderQty).IsRequired(); + b.Property(q => q.StdPackQty).IsRequired(); + b.Property(q => q.SupplierPackConvertRate); + b.Property(q => q.IsConsignment).IsRequired(); + b.Property(q => q.LineStatus).IsRequired(); + b.Property(q => q.Remark).HasMaxLength(4096); + }); + } + + + private static void ConfigUnplannedReceipt(this ModelBuilder builder, + V1ScpModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_UnplannedReceipt", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.TrNbr).IsRequired(); + b.Property(q => q.TrType).IsRequired().HasMaxLength(8); + b.Property(q => q.Order).HasMaxLength(64); + b.Property(q => q.Location).IsRequired().HasMaxLength(8); + b.Property(q => q.EffectiveDate).IsRequired(); + b.Property(q => q.SystemDate).IsRequired(); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(18); + b.Property(q => q.Lot).IsRequired().HasMaxLength(64); + b.Property(q => q.Uom).IsRequired().HasMaxLength(8); + b.Property(q => q.Qty).IsRequired(); + b.Property(q => q.SoJob).HasMaxLength(20); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(q => q.Site).IsRequired().HasMaxLength(8); + b.Property(q => q.Company).IsRequired().HasMaxLength(8); + }); + */ + } + + +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpEntityFrameworkCoreModule.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..c617b71 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpEntityFrameworkCoreModule.cs @@ -0,0 +1,60 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.DependencyInjection; +using Volo.Abp.Modularity; +using Win_in.Sfs.Scp.v1.Domain; +using Win_in.Sfs.Scp.WebApi; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + [DependsOn( + typeof(V1ScpDomainModule) + )] + public class V1ScpEntityFrameworkCoreModule : AbpModule + { + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Remove "includeAllEntities: true" to create + * default repositories only for aggregate roots */ + + // options.AddDefaultRepositories(includeAllEntities: true); + + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + + // Configure(o => + // { + // o.Entity(c => + // { + // c.DefaultWithDetailsFunc = query => query.Include(po => po.Details); + // }); + // }); + + }); + + /* + context.Services.AddAbpDbContext(options => + { + options.AddDefaultRepositories(includeAllEntities: true); + }); + */ + + + + Configure(options => + { + /* The main point to change your DBMS. + * See also WebApiMigrationsDbContextFactory for EF Core tooling. */ + options.UseSqlServer(); + }); + + } + } +} diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpModelBuilderConfigurationOptions.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpModelBuilderConfigurationOptions.cs new file mode 100644 index 0000000..ddedcbe --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpModelBuilderConfigurationOptions.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore +{ + public class V1ScpModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + { + public V1ScpModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) + { + + } + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Win_in.Sfs.Scp.v1.EntityFrameworkCore.csproj b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Win_in.Sfs.Scp.v1.EntityFrameworkCore.csproj index f208d30..ace59b8 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Win_in.Sfs.Scp.v1.EntityFrameworkCore.csproj +++ b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Win_in.Sfs.Scp.v1.EntityFrameworkCore.csproj @@ -1,7 +1,16 @@ - + net5.0 + + + + + + + + +