From 0b802cb8704eb0cbd1131e47eb3bb5bc81ae6c78 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Sat, 22 Jan 2022 12:33:06 +0800 Subject: [PATCH 1/2] 1 --- ...ApiHostMigrationsDbContextModelSnapshot.cs | 449 ++++++++++++------ 1 file changed, 307 insertions(+), 142 deletions(-) diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs index 29cd5e30..7d623205 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -5303,6 +5303,92 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_PriceList"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + 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("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListBJ"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersion", b => { b.Property("Id") @@ -5379,6 +5465,82 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_PriceListVersion"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersionBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersionBJ"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecMatch.SecMatchBase", b => { b.Property("Id") @@ -8487,6 +8649,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("OutPutQty") + .HasColumnType("decimal(18,2)"); + b.Property("ParentMaterialCode") .HasMaxLength(36) .HasColumnType("nvarchar(36)"); @@ -8888,6 +9053,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("OutPutQty") + .HasColumnType("decimal(18,2)"); + b.Property("ParentMaterialCode") .HasMaxLength(36) .HasColumnType("nvarchar(36)"); @@ -8923,7 +9091,7 @@ namespace Win.Sfs.SettleAccount.Migrations .IsUnique() .HasFilter("IsDeleted=0"); - b.ToTable("Set_WmsHQMSharePartOutPutDetial"); + b.ToTable("Set_WmsHQHSharePartOutPutDetial"); }); modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanOutPut", b => @@ -9200,6 +9368,132 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_WmsHQMSharePartOutPut"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartOutPutDetial", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend1") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Extend2") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("MaterialGroup") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderBillNum") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OutPut") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OutPutQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentMaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("TaskId") + .HasColumnType("uniqueidentifier"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WmsBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version"); + + b.ToTable("Set_WmsHQMSharePartOutPutDetial"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPut", b => { b.Property("Id") @@ -9803,10 +10097,6 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("Batch") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - b.Property("BranchId") .HasColumnType("uniqueidentifier"); @@ -9838,21 +10128,10 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("Enabled") .HasColumnType("bit"); - b.Property("Extend") - .HasColumnType("nvarchar(max)"); - b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); - b.Property("Factory") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Flag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("bit") @@ -9877,19 +10156,10 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(150) .HasColumnType("nvarchar(150)"); - b.Property("ParentId") - .HasColumnType("uniqueidentifier"); - b.Property("PartType") .HasMaxLength(50) .HasColumnType("nvarchar(50)"); - b.Property("Period") - .HasColumnType("nvarchar(max)"); - - b.Property("Qty") - .HasColumnType("decimal(18,2)"); - b.Property("Relation") .HasMaxLength(100) .HasColumnType("nvarchar(100)"); @@ -9897,27 +10167,11 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("Remark") .HasColumnType("nvarchar(max)"); - b.Property("SettleDate") - .HasColumnType("datetime2"); - - b.Property("SettleInputDate") - .HasColumnType("datetime2"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("SupplierCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - b.Property("Version") - .HasColumnType("nvarchar(450)"); - - b.Property("WMSActualGoodsDate") .HasColumnType("nvarchar(max)"); - b.Property("WMSDeliverGoodsState") - .HasColumnType("nvarchar(max)"); + b.Property("WMSActualGoodsDate") + .HasColumnType("datetime2"); b.Property("WMSDeliveryNote") .HasColumnType("nvarchar(max)"); @@ -9925,18 +10179,8 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("WMSDeliveryQty") .HasColumnType("decimal(18,2)"); - b.Property("WMSKanBanState") - .HasColumnType("nvarchar(max)"); - - b.Property("Year") - .HasColumnType("nvarchar(max)"); - b.HasKey("Id"); - b.HasIndex("Version", "Kanban", "MaterialCode") - .IsUnique() - .HasFilter("IsDeleted=0"); - b.ToTable("Set_WMSKanBanSettle"); }); @@ -10029,17 +10273,6 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("AccountNum") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("AmountNoTax") - .HasColumnType("decimal(18,2)"); - - b.Property("BatchNo") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - b.Property("BranchId") .HasColumnType("uniqueidentifier"); @@ -10065,41 +10298,13 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); - b.Property("DeliveryLineNum") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("DeliveryOrderNo") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - b.Property("Enabled") .HasColumnType("bit"); - b.Property("Extend") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); - b.Property("Factory") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("FactoryName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("GermanInvoiceNo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("InvoicedQty") - .HasColumnType("decimal(18,2)"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("bit") @@ -10114,9 +10319,8 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.Property("LineNumber") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("MainFactory") + .HasColumnType("nvarchar(max)"); b.Property("MaterialCode") .IsRequired() @@ -10124,32 +10328,14 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("nvarchar(150)"); b.Property("MaterialDesc") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); - b.Property("Period") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); + b.Property("MaterialGroup") + .HasColumnType("nvarchar(max)"); b.Property("PurchaseOrderNo") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("PurchaseOrderNoItem") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("PurchaseOrderNoText") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("PurchasePriceNoTax") - .HasColumnType("decimal(18,2)"); - - b.Property("PurchaseType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("nvarchar(max)"); b.Property("ReceiptQty") .HasColumnType("decimal(18,2)"); @@ -10157,42 +10343,21 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("Remark") .HasColumnType("nvarchar(max)"); - b.Property("SpareDate") - .HasColumnType("datetime2"); - - b.Property("TaxCode") + b.Property("SapCode") .HasColumnType("nvarchar(max)"); - b.Property("TaxRate") - .HasColumnType("decimal(18,2)"); - - b.Property("Unit") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("SpareDate") + .HasColumnType("datetime2"); b.Property("Version") .HasMaxLength(36) .HasColumnType("nvarchar(36)"); - b.Property("WMSDeliverGoodsState") - .HasColumnType("nvarchar(max)"); - b.Property("WMSDeliveryNote") .HasColumnType("nvarchar(max)"); - b.Property("WMSSparePartState") - .HasColumnType("nvarchar(max)"); - - b.Property("Year") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - b.HasKey("Id"); - b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode") - .IsUnique() - .HasFilter("IsDeleted=0"); - b.ToTable("Set_WMSSparePart"); }); From c833b94c6dfd4c903be371c95f8339fdfa40d9a0 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Sat, 22 Jan 2022 12:45:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E5=92=8C=E5=A4=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9=E7=9A=84=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WMS-KanBan/WMSKanBanAppService.cs | 3 +- .../WMS-SparePart/WMSSparePartAppService.cs | 4 +- ...ttleAccountApplicationAutoMapperProfile.cs | 10 +- .../Entities/WMS-KanBan/WMSKanBanSettle.cs | 261 +++++++----- .../Entities/WMS-SparePart/WMSSparePart.cs | 371 +++++++++++------- ...AccountDbContextModelCreatingExtensions.cs | 62 +-- .../SettleKBWithCodeDapperReportRepository.cs | 47 ++- .../Report/SettleKBWithCodeExportService.cs | 35 +- 8 files changed, 509 insertions(+), 284 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-KanBan/WMSKanBanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-KanBan/WMSKanBanAppService.cs index 07c1a9ee..a9ba9cf6 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-KanBan/WMSKanBanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-KanBan/WMSKanBanAppService.cs @@ -104,7 +104,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan _bomList.Add(new WMSKanBanVersion(_id, branchId, year, period, version, customerCode)); foreach (var itm in entityList) { - itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id); + //itm.SetValue(GuidGenerator.Create(), year, period, version); + itm.SetValue(GuidGenerator.Create(), version); } if (checkList.Count > 0) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-SparePart/WMSSparePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-SparePart/WMSSparePartAppService.cs index 59bd24f0..f9c2bfd7 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-SparePart/WMSSparePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS-SparePart/WMSSparePartAppService.cs @@ -91,12 +91,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart await _query.BatchDeleteAsync(); //插入数据前检验 var checkList = new List(); - var _group = entityList.GroupBy(x => new { x.LineNumber, x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), LineNumber = p.Key.LineNumber, MaterialCode = p.Key.MaterialCode }); + var _group = entityList.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode }); foreach (var itm in _group) { if (string.IsNullOrEmpty(itm.MaterialCode)) { - checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的行号为{0}的物料代码为空,请检查!", itm.LineNumber), string.Empty)); + checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的行号为{0}的物料代码为空,请检查!", itm.MaterialCode), string.Empty)); } } var _id = GuidGenerator.Create(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 9c44fdb6..17861bb4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -385,11 +385,11 @@ namespace Win.Sfs.SettleAccount { CreateMap().ReverseMap(); CreateMap().ReverseMap(); - CreateMap() - .ForMember(dest => dest.SettleInputDate, - opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleInputDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture))) - .ForMember(dest => dest.SettleDate, - opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture))); + //CreateMap() + // .ForMember(dest => dest.SettleInputDate, + // opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleInputDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture))) + // .ForMember(dest => dest.SettleDate, + // opt => opt.MapFrom(src => DateTime.ParseExact(src.SettleDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture))); CreateMap().ReverseMap(); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs index 44b45ffb..0be2eae0 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs @@ -9,16 +9,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan { public class WMSKanBanSettle : FullAuditedAggregateRootBase, ISettleAccountEntityBase { - /// - ///年度 - /// - public string Year { get; protected set; } - - /// - /// 期间 - /// - public string Period { set; get; } - + public Guid Id { set; get; } /// /// 版本 /// @@ -34,10 +25,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan public string Relation { set; get; } /// - /// 工厂 - /// - public string Factory { set; get; } - /// /// 零件号 /// public string MaterialCode { set; get; } @@ -45,41 +32,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan /// 零件类型 /// public string PartType { set; get; } - /// - /// 供应商编码 - /// - public string SupplierCode { set; get; } - /// - /// R3入库时间 - /// - public DateTime SettleInputDate { set; get; } - - - /// - /// 批次 - /// - public string Batch { set; get; } - - - /// - /// 入库结算标识 - /// - public string Flag { set; get; } - /// - /// 数量 - /// - public decimal Qty { set; get; } - - - /// - /// R3结算时间 - /// - public DateTime SettleDate { set; get; } - /// - /// 结算状态 - /// - public string State { set; get; } - + /// /// WMS交货单 @@ -89,85 +42,43 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan /// /// WMS实际发货日期 /// - public string WMSActualGoodsDate { set; get; } + public DateTime WMSActualGoodsDate { set; get; } /// /// WMS交货数量 /// public decimal WMSDeliveryQty { set; get; } - /// - /// WMS发货状态 - /// - public string WMSDeliverGoodsState { set; get; } - - /// - /// 看板结算状态 - /// - public string WMSKanBanState { set; get; } - /// /// 出库单号 /// public string DeliveryOrderNo { set; get; } - /// - /// 备注 - /// - public string Extend { set; get; } - public Guid ParentId { get; protected set; } - - public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId) + public void SetValue(Guid guid, string version) { - Period = peroid; - Year = year; Id = guid; Version = version; - BranchId = branchId; - ParentId = parentId; } public WMSKanBanSettle() { } public WMSKanBanSettle( Guid id, Guid branchId, - string year, string version, string kanban, string relation, - string factory, string materialCode, string partType, - DateTime settleInputDate, - string supplierCode, - decimal qty, - string batch, - string flag, - DateTime settleDate, - string state, - Guid parentId, - //DateTime creationTime, Guid guid) : base(id) { BranchId = branchId; - Year = year; Version = version; Kanban = kanban; Relation = relation; - Factory = factory; MaterialCode = materialCode; PartType = partType; - SettleInputDate = settleInputDate; - SupplierCode = supplierCode; - Qty = qty; - Batch = batch; - Flag = flag; - SettleDate = settleDate; - State = state; - ParentId = parentId; - //CreationTime = creationTime; CreatorId = guid; } @@ -176,4 +87,168 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan } + //public class WMSKanBanSettle : FullAuditedAggregateRootBase, ISettleAccountEntityBase + //{ + // /// + // ///年度 + // /// + // public string Year { get; protected set; } + + // /// + // /// 期间 + // /// + // public string Period { set; get; } + + // /// + // /// 版本 + // /// + // public string Version { set; get; } + // /// + // /// 看板条码号 + // /// + // public string Kanban { set; get; } + + // /// + // /// 入库关联号 + // /// + + // public string Relation { set; get; } + // /// + // /// 工厂 + // /// + // public string Factory { set; get; } + // /// + // /// 零件号 + // /// + // public string MaterialCode { set; get; } + // /// + // /// 零件类型 + // /// + // public string PartType { set; get; } + // /// + // /// 供应商编码 + // /// + // public string SupplierCode { set; get; } + // /// + // /// R3入库时间 + // /// + // public DateTime SettleInputDate { set; get; } + + + // /// + // /// 批次 + // /// + // public string Batch { set; get; } + + + // /// + // /// 入库结算标识 + // /// + // public string Flag { set; get; } + // /// + // /// 数量 + // /// + // public decimal Qty { set; get; } + + + // /// + // /// R3结算时间 + // /// + // public DateTime SettleDate { set; get; } + // /// + // /// 结算状态 + // /// + // public string State { set; get; } + + + // /// + // /// WMS交货单 + // /// + // public string WMSDeliveryNote { set; get; } + + // /// + // /// WMS实际发货日期 + // /// + // public string WMSActualGoodsDate { set; get; } + + // /// + // /// WMS交货数量 + // /// + // public decimal WMSDeliveryQty { set; get; } + + // /// + // /// WMS发货状态 + // /// + // public string WMSDeliverGoodsState { set; get; } + + // /// + // /// 看板结算状态 + // /// + // public string WMSKanBanState { set; get; } + + // /// + // /// 出库单号 + // /// + // public string DeliveryOrderNo { set; get; } + + // /// + // /// 备注 + // /// + + // public string Extend { set; get; } + + + // public void SetValue(Guid guid, string year, string peroid, string version) + // { + // Period = peroid; + // Year = year; + // Id = guid; + // Version = version; + // } + // public WMSKanBanSettle() + // { } + // public WMSKanBanSettle( + // Guid id, + // Guid branchId, + // string year, + // string version, + // string kanban, + // string relation, + // string factory, + // string materialCode, + // string partType, + // DateTime settleInputDate, + // string supplierCode, + // decimal qty, + // string batch, + // string flag, + // DateTime settleDate, + // string state, + // //DateTime creationTime, + // Guid guid) : base(id) + // { + // BranchId = branchId; + // Year = year; + // Version = version; + // Kanban = kanban; + // Relation = relation; + // Factory = factory; + // MaterialCode = materialCode; + // PartType = partType; + // SettleInputDate = settleInputDate; + // SupplierCode = supplierCode; + // Qty = qty; + // Batch = batch; + // Flag = flag; + // SettleDate = settleDate; + // State = state; + // //CreationTime = creationTime; + // CreatorId = guid; + // } + + + + + + //} } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-SparePart/WMSSparePart.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-SparePart/WMSSparePart.cs index ec23a8c6..bb3cb651 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-SparePart/WMSSparePart.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-SparePart/WMSSparePart.cs @@ -15,8 +15,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version) { - Period = peroid; - Year = year; + //Period = peroid; + //Year = year; Id = guid; Version = version; BranchId = branchId; @@ -29,187 +29,280 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart ) : base(Id) { - Year = year; - Period = period; Version = version; - LineNumber = lineNumber; - PurchaseType = purchaseType; - PurchaseOrderNo = purchaseOrderNo; - PurchaseOrderNoItem = purchaseOrderNoItem; - PurchaseOrderNoText = purchaseOrderNoText; ReceiptQty = receiptQty; - InvoicedQty = invoicedQty; - AmountNoTax = amountNoTax; - PurchasePriceNoTax = purchasePriceNoTax; - AccountNum = accountNum; MaterialCode = materialCode; MaterialDesc = materialDesc; SpareDate = spareDate; - DeliveryOrderNo = deliveryOrderNo; - DeliveryLineNum = deliveryLineNum; - BatchNo = batchNo; - Unit = unit; - TaxRate = taxRate; - TaxCode = taxCode; - Factory = factory; } - //行号 采购类型 采购订单号 采购订单行项目 采购订单文本 收货数量 开票数量 不含税金额 采购价格不含税 - //科目号 物料代码 物料描述 日期 交货单号 交货行号 批次号 单位 税率 税码 - //德国发票号 AP_REQUISITION_MIMRS.GERMANY_INVOCE_AMOUNT 借贷 PO币种 工厂 工厂名称 BM 单号 - - /// - ///年 - /// - [Display(Name = "年")] - public string Year { get; set; } - /// - /// 期间 - /// - [Display(Name = "交货日期")] - public string Period { set; get; } /// /// 版本号 /// [Display(Name = "版本号")] public string Version { set; get; } - /// - /// 行号 - /// - [Display(Name = "行号")] - public string LineNumber { set; get; } /// - /// 采购类型 + /// SAP物料号 /// - [Display(Name = "采购类型")] - public string PurchaseType { get; set; } + [Display(Name = "SAP物料号")] + public string SapCode { get; set; } - /// - /// 采购订单号 - /// - [Display(Name = "采购订单号")] - public string PurchaseOrderNo { get; set; } - /// - /// 采购订单行项目 - /// - [Display(Name = "采购订单行项目")] - public string PurchaseOrderNoItem { get; set; } - /// - /// 采购订单文本 - /// - [Display(Name = "采购订单文本")] - public string PurchaseOrderNoText { get; set; } - /// - /// 收货数量 - /// - [Display(Name = "发货数量")] - public decimal ReceiptQty { get; set; } /// - /// 开票数量 + /// 主机厂 /// - [Display(Name = "开票数量")] - public decimal InvoicedQty { get; set; } - /// - /// 不含税金额 - /// - [Display(Name = "不含税金额")] - public decimal AmountNoTax { get; set; } - /// - /// 采购价格不含税 - /// - [Display(Name = "采购价格不含税")] - public decimal PurchasePriceNoTax { get; set; } + [Display(Name = "主机厂")] + public string MainFactory { get; set; } + /// - /// 科目号 + /// 车型 /// - [Display(Name = "科目号")] - public string AccountNum { get; set; } + [Display(Name = "车型")] + public string MaterialGroup { get; set; } + + /// - /// 物料代码 + /// 物料代码-零件号 /// [Display(Name = "物料代码")] public string MaterialCode { get; set; } /// - /// 物料描述 + /// 物料描述-存货名称 /// [Display(Name = "物料描述")] public string MaterialDesc { get; set; } + /// - /// 日期 - /// - [Display(Name = "订单日期")] - public DateTime SpareDate { get; set; } - /// - /// 交货单号 - /// - [Display(Name = "交货单号")] - public string DeliveryOrderNo { get; set; } - /// - /// 交货行号 - /// - [Display(Name = "交货行号")] - public string DeliveryLineNum { get; set; } - /// - /// 批次号 - /// - [Display(Name = "批次号")] - public string BatchNo { get; set; } - /// - /// 单位 - /// - [Display(Name = "单位")] - public string Unit { get; set; } - /// - /// 税率 - /// - [Display(Name = "税率")] - public decimal TaxRate { get; set; } - /// - /// 税码 - /// - [Display(Name = "税码")] - public string TaxCode { get; set; } - /// - /// 德国发票号 - /// - [Display(Name = "德国发票号")] - public string GermanInvoiceNo { get; set; } - /// - /// 工厂 - /// - [Display(Name = "工厂")] - public string Factory { get; set; } - /// - /// 工厂名称 + /// 发货数量 /// - [Display(Name = "工厂名称")] - public string FactoryName { get; set; } + [Display(Name = "发货数量")] + public decimal ReceiptQty { get; set; } + /// - /// 备注 + /// 订单号 /// - [Display(Name = "备注")] - public string Extend { set; get; } + [Display(Name = "订单号")] + public string PurchaseOrderNo { get; set; } /// - /// WMS采购订单号 + /// 交货单号 /// + [Display(Name = "交货单号")] public string WMSDeliveryNote { set; get; } /// - /// WMS发货状态 + /// 交货日期 /// - public string WMSDeliverGoodsState { set; get; } + [Display(Name = "交货日期")] + public DateTime SpareDate { get; set; } - /// - /// 看板结算状态 - /// - public string WMSSparePartState { set; get; } + } + //public class WMSSparePart : FullAuditedAggregateRootBase, ISettleAccountEntityBase + //{ + // public WMSSparePart() + // { } + // public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version) + // { + // Period = peroid; + // Year = year; + // Id = guid; + // Version = version; + // BranchId = branchId; + // } + // public WMSSparePart(Guid Id, string year, string period, string version, string lineNumber, + // string purchaseType, string purchaseOrderNo, string purchaseOrderNoItem, string purchaseOrderNoText, + // decimal receiptQty, decimal invoicedQty, decimal amountNoTax, decimal purchasePriceNoTax, + // string accountNum, string materialCode, string materialDesc, DateTime spareDate, string deliveryOrderNo, + // string deliveryLineNum, string batchNo, string unit, decimal taxRate, string taxCode, string factory - } + // ) : base(Id) + // { + // Year = year; + // Period = period; + // Version = version; + // LineNumber = lineNumber; + // PurchaseType = purchaseType; + // PurchaseOrderNo = purchaseOrderNo; + // PurchaseOrderNoItem = purchaseOrderNoItem; + // PurchaseOrderNoText = purchaseOrderNoText; + // ReceiptQty = receiptQty; + // InvoicedQty = invoicedQty; + // AmountNoTax = amountNoTax; + // PurchasePriceNoTax = purchasePriceNoTax; + // AccountNum = accountNum; + // MaterialCode = materialCode; + // MaterialDesc = materialDesc; + // SpareDate = spareDate; + // DeliveryOrderNo = deliveryOrderNo; + // DeliveryLineNum = deliveryLineNum; + // BatchNo = batchNo; + // Unit = unit; + // TaxRate = taxRate; + // TaxCode = taxCode; + // Factory = factory; + // } + + // //行号 采购类型 采购订单号 采购订单行项目 采购订单文本 收货数量 开票数量 不含税金额 采购价格不含税 + // //科目号 物料代码 物料描述 日期 交货单号 交货行号 批次号 单位 税率 税码 + // //德国发票号 AP_REQUISITION_MIMRS.GERMANY_INVOCE_AMOUNT 借贷 PO币种 工厂 工厂名称 BM 单号 + + // /// + // ///年 + // /// + // [Display(Name = "年")] + // public string Year { get; set; } + // /// + // /// 期间 + // /// + // [Display(Name = "交货日期")] + // public string Period { set; get; } + // /// + // /// 版本号 + // /// + // [Display(Name = "版本号")] + // public string Version { set; get; } + + // /// + // /// 行号 + // /// + // [Display(Name = "行号")] + // public string LineNumber { set; get; } + + + // /// + // /// 采购类型 + // /// + // [Display(Name = "采购类型")] + // public string PurchaseType { get; set; } + + // /// + // /// 采购订单号 + // /// + // [Display(Name = "采购订单号")] + // public string PurchaseOrderNo { get; set; } + // /// + // /// 采购订单行项目 + // /// + // [Display(Name = "采购订单行项目")] + // public string PurchaseOrderNoItem { get; set; } + // /// + // /// 采购订单文本 + // /// + // [Display(Name = "采购订单文本")] + // public string PurchaseOrderNoText { get; set; } + // /// + // /// 收货数量 + // /// + // [Display(Name = "发货数量")] + // public decimal ReceiptQty { get; set; } + + // /// + // /// 开票数量 + // /// + // [Display(Name = "开票数量")] + // public decimal InvoicedQty { get; set; } + // /// + // /// 不含税金额 + // /// + // [Display(Name = "不含税金额")] + // public decimal AmountNoTax { get; set; } + // /// + // /// 采购价格不含税 + // /// + // [Display(Name = "采购价格不含税")] + // public decimal PurchasePriceNoTax { get; set; } + // /// + // /// 科目号 + // /// + // [Display(Name = "科目号")] + // public string AccountNum { get; set; } + // /// + // /// 物料代码 + // /// + // [Display(Name = "物料代码")] + // public string MaterialCode { get; set; } + // /// + // /// 物料描述 + // /// + // [Display(Name = "物料描述")] + // public string MaterialDesc { get; set; } + // /// + // /// 日期 + // /// + // [Display(Name = "订单日期")] + // public DateTime SpareDate { get; set; } + // /// + // /// 交货单号 + // /// + // [Display(Name = "交货单号")] + // public string DeliveryOrderNo { get; set; } + // /// + // /// 交货行号 + // /// + // [Display(Name = "交货行号")] + // public string DeliveryLineNum { get; set; } + // /// + // /// 批次号 + // /// + // [Display(Name = "批次号")] + // public string BatchNo { get; set; } + // /// + // /// 单位 + // /// + // [Display(Name = "单位")] + // public string Unit { get; set; } + // /// + // /// 税率 + // /// + // [Display(Name = "税率")] + // public decimal TaxRate { get; set; } + // /// + // /// 税码 + // /// + // [Display(Name = "税码")] + // public string TaxCode { get; set; } + // /// + // /// 德国发票号 + // /// + // [Display(Name = "德国发票号")] + // public string GermanInvoiceNo { get; set; } + // /// + // /// 工厂 + // /// + // [Display(Name = "工厂")] + // public string Factory { get; set; } + // /// + // /// 工厂名称 + // /// + // [Display(Name = "工厂名称")] + // public string FactoryName { get; set; } + // /// + // /// 备注 + // /// + // [Display(Name = "备注")] + // public string Extend { set; get; } + + // /// + // /// WMS采购订单号 + // /// + // public string WMSDeliveryNote { set; get; } + + // /// + // /// WMS发货状态 + // /// + // public string WMSDeliverGoodsState { set; get; } + + // /// + // /// 看板结算状态 + // /// + // public string WMSSparePartState { set; get; } + + + + //} } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 49a17aaa..343c9ee7 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -862,37 +862,37 @@ namespace Win.Sfs.SettleAccount b.ToTable($"{options.TablePrefix}_WMSSparePart", options.Schema); b.ConfigureByConvention(); - b.Property(x => x.Year).HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.Period).HasMaxLength(CommonConsts.MaxCodeLength); + //b.Property(x => x.Year).HasMaxLength(CommonConsts.MaxCodeLength); + //b.Property(x => x.Period).HasMaxLength(CommonConsts.MaxCodeLength); b.Property(x => x.Version).HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.LineNumber).HasMaxLength(50); - b.Property(x => x.PurchaseType).HasMaxLength(50); - b.Property(x => x.PurchaseOrderNo).IsRequired().HasMaxLength(50); - b.Property(x => x.PurchaseOrderNoItem).HasMaxLength(50); - b.Property(x => x.PurchaseOrderNoText).HasMaxLength(50); + //b.Property(x => x.LineNumber).HasMaxLength(50); + //b.Property(x => x.PurchaseType).HasMaxLength(50); + //b.Property(x => x.PurchaseOrderNo).IsRequired().HasMaxLength(50); + //b.Property(x => x.PurchaseOrderNoItem).HasMaxLength(50); + //b.Property(x => x.PurchaseOrderNoText).HasMaxLength(50); b.Property(x => x.ReceiptQty).IsRequired(); - b.Property(x => x.InvoicedQty).IsRequired(); - b.Property(x => x.AmountNoTax).IsRequired(); - b.Property(x => x.PurchasePriceNoTax).IsRequired(); + //b.Property(x => x.InvoicedQty).IsRequired(); + //b.Property(x => x.AmountNoTax).IsRequired(); + //b.Property(x => x.PurchasePriceNoTax).IsRequired(); - b.Property(x => x.AccountNum).HasMaxLength(50); + //b.Property(x => x.AccountNum).HasMaxLength(50); b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150); - b.Property(x => x.MaterialDesc).HasMaxLength(50); + b.Property(x => x.MaterialDesc).HasMaxLength(500); b.Property(x => x.SpareDate); - b.Property(x => x.DeliveryOrderNo).IsRequired().HasMaxLength(50); - b.Property(x => x.DeliveryLineNum).HasMaxLength(50); - b.Property(x => x.BatchNo).HasMaxLength(50); - b.Property(x => x.Unit).HasMaxLength(50); - b.Property(x => x.TaxRate); - b.Property(x => x.TaxCode); - b.Property(x => x.GermanInvoiceNo).HasMaxLength(100); - b.Property(x => x.Factory).HasMaxLength(50); - b.Property(x => x.FactoryName).HasMaxLength(50); - b.Property(x => x.Extend).HasMaxLength(250); + //b.Property(x => x.DeliveryOrderNo).IsRequired().HasMaxLength(50); + //b.Property(x => x.DeliveryLineNum).HasMaxLength(50); + //b.Property(x => x.BatchNo).HasMaxLength(50); + //b.Property(x => x.Unit).HasMaxLength(50); + //b.Property(x => x.TaxRate); + //b.Property(x => x.TaxCode); + //b.Property(x => x.GermanInvoiceNo).HasMaxLength(100); + //b.Property(x => x.Factory).HasMaxLength(50); + //b.Property(x => x.FactoryName).HasMaxLength(50); + //b.Property(x => x.Extend).HasMaxLength(250); //创建索引(没有版本一说) - b.HasIndex(x => new { x.Version,x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); + //b.HasIndex(x => new { x.Version,x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); }); } @@ -933,14 +933,20 @@ namespace Win.Sfs.SettleAccount b.ConfigureByConvention(); b.Property(x => x.Kanban).IsRequired().HasMaxLength(150);//必填项 b.Property(x => x.Relation).HasMaxLength(100); - b.Property(x => x.Factory).HasMaxLength(50); b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150); b.Property(x => x.PartType).HasMaxLength(50); - b.Property(x => x.SupplierCode).HasMaxLength(50); - b.Property(x => x.Batch).HasMaxLength(50); - b.Property(x => x.Flag).HasMaxLength(50); + + //b.ConfigureByConvention(); + //b.Property(x => x.Kanban).IsRequired().HasMaxLength(150);//必填项 + //b.Property(x => x.Relation).HasMaxLength(100); + //b.Property(x => x.Factory).HasMaxLength(50); + //b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150); + //b.Property(x => x.PartType).HasMaxLength(50); + //b.Property(x => x.SupplierCode).HasMaxLength(50); + //b.Property(x => x.Batch).HasMaxLength(50); + //b.Property(x => x.Flag).HasMaxLength(50); //创建组合索引 - b.HasIndex(x => new { x.Version,x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); + //b.HasIndex(x => new { x.Version,x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); }); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs index b89de6ea..f6e01205 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs @@ -43,7 +43,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " SELECT\n" + " row_number() over(order by b.EstimateTypeDesc) as RowId ,\n" + " c.WMSDeliveryNote,--交货单号\n" + - " c.WMSActualGoodsDate,--实际发货日期\n" + + " CONVERT ( VARCHAR ( 100 ), c.WMSActualGoodsDate, 23 ) AS WMSActualGoodsDate,--实际发货日期年-月-日\n" + " a.Kanban,--条码号\n" + " b.MaterialCode SapMaterialCode,--厂内物料号\n" + @@ -59,7 +59,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " 0 AS InvoiceDiffQty,--开票数量,默认0,后续拿算法动态算\n" + " d.InvoicePrice,--开票单价\n" + " 0 AS InvoiceMoney,--开票金额\n" + - " c.DeliveryOrderNo --出库单号\n" + + " '' DeliveryOrderNo --出库单号\n" + " \n" + " FROM\n" + " Set_KanBanSettle AS a\n" + @@ -96,6 +96,39 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _query.ToList(); } + + + public virtual List GetVWKanBanInvoiceDiff(string version) + { + var str = "SELECT\n" + + " * \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " b.MaterialCode,\n" + + " InvocieQty-SettleQty DiffQty \n" + + " FROM\n" + + " ( SELECT sum( Qty ) SettleQty, MaterialCode FROM Set_KanBanSettle a WHERE version = '{0}' GROUP BY MaterialCode ) a\n" + + " INNER JOIN ( SELECT SUM( QTY ) InvocieQty, MaterialCode FROM Set_Invoice WHERE version = '{0}' GROUP BY MaterialCode ) b ON a.MaterialCode = b.MaterialCode \n" + + " ) temp \n" + + " WHERE\n" + + " temp.DiffQty <>0"; + var _list = DbConnection.Query(string.Format(str, version)); + return _list.ToList(); + } + + + + + + + + + + + + + /// /// /// @@ -189,8 +222,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "交货单号")] public string WMSDeliveryNote { set; get; } - [ExporterHeader(DisplayName = "实际发货日期")] - public DateTime ActualGoodsDate { set; get; } + [ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")] + public DateTime WMSActualGoodsDate { set; get; } [ExporterHeader(DisplayName = "条码号")] public string Kanban { set; get; } @@ -204,8 +237,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "客户物料")] public string CustomerPartCode { set; get; } - [ExporterHeader(DisplayName = "厂内物料号")] - public string SapMaterialCode { set; get; } + //[ExporterHeader(DisplayName = "厂内物料号")] + //public string SapMaterialCode { set; get; } [ExporterHeader(DisplayName = "物料组(车型)")] @@ -223,7 +256,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "结算数量")] public decimal SettleNumber { set; get; } - [ExporterHeader(DisplayName = "结算日期")] + [ExporterHeader(DisplayName = "结算日期", Format = "yyyy-MM-dd")] public DateTime SettleDate { set; get; } [ExporterHeader(DisplayName = "结算金额")] diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs index 27b450a3..3e16e839 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs @@ -41,13 +41,13 @@ namespace SettleAccount.Job.Services.Report var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; - var _list = _dapper.GetSettleKBWithCodeReportList(kanban, version, sapMaterialCode, customerPartCode,materialGroup, beginTime, endTime); - var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version); + var _list = _dapper.GetSettleKBWithCodeReportList(kanban, version, sapMaterialCode, customerPartCode, materialGroup, beginTime, endTime); + var diffList = _dapper.GetVWKanBanInvoiceDiff(version); if (diffList != null) { foreach (var itm in diffList) { - var _first = _list.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode); + var _first = _list.FirstOrDefault(p => p.CustomerPartCode == itm.MaterialCode);//结算物料号去匹配发票汇总中的物料号 if (_first != null) { _first.InvoiceDiffQty = _first.SettleNumber + itm.DiffQty;//开票数量(结算数量+差异) @@ -64,15 +64,23 @@ namespace SettleAccount.Job.Services.Report _list = _list.Where(p => _groupList.Contains(p.EstimateTypeDesc)).ToList(); } } - + if (!string.IsNullOrEmpty(sapMaterialCode)) { var _groupList = sapMaterialCode.Split(new char[] { '\n' }).Distinct().ToList(); if (_groupList.Count() > 0) { - _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); + _list = _list.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } } + //if (!string.IsNullOrEmpty(sapMaterialCode)) + //{ + // var _groupList = sapMaterialCode.Split(new char[] { '\n' }).Distinct().ToList(); + // if (_groupList.Count() > 0) + // { + // _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); + // } + //} if (!string.IsNullOrEmpty(customerPartCode)) { @@ -85,13 +93,22 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(beginTime)) { - _list = _list.Where(p => DateTime.Parse(beginTime)<=p.ActualGoodsDate).ToList(); + _list = _list.Where(p => DateTime.Parse(beginTime) <= p.WMSActualGoodsDate).ToList(); } if (!string.IsNullOrEmpty(endTime)) { - _list = _list.Where(p => DateTime.Parse(endTime) >= p.ActualGoodsDate).ToList(); + _list = _list.Where(p => DateTime.Parse(endTime) >= p.WMSActualGoodsDate).ToList(); } + //if (!string.IsNullOrEmpty(beginTime)) + //{ + // _list = _list.Where(p => DateTime.Parse(beginTime)<=p.ActualGoodsDate).ToList(); + //} + //if (!string.IsNullOrEmpty(endTime)) + //{ + // _list = _list.Where(p => DateTime.Parse(endTime) >= p.ActualGoodsDate).ToList(); + //} + if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); @@ -101,10 +118,10 @@ namespace SettleAccount.Job.Services.Report } } - - _outputService.Export(id,_filename , _list); + + _outputService.Export(id, _filename, _list); return id.ToString(); }