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 eef50a86..07fef7e1 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -6810,6 +6810,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); + b.Property("DeliveryOrderNo") + .HasColumnType("nvarchar(max)"); + b.Property("Enabled") .HasColumnType("bit"); @@ -6888,12 +6891,18 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("Version") .HasColumnType("nvarchar(450)"); + b.Property("WMSActualGoodsDate") + .HasColumnType("nvarchar(max)"); + b.Property("WMSDeliverGoodsState") .HasColumnType("nvarchar(max)"); b.Property("WMSDeliveryNote") .HasColumnType("nvarchar(max)"); + b.Property("WMSDeliveryQty") + .HasColumnType("decimal(18,2)"); + b.Property("WMSKanBanState") .HasColumnType("nvarchar(max)"); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs index 983820a7..a3aba35b 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs @@ -77,6 +77,17 @@ namespace Win.Sfs.SettleAccount.Entities.WMSKanBan /// public string WMSDeliveryNote { set; get; } + /// + /// WMS实际发货日期 + /// + public string WMSActualGoodsDate { set; get; } + + + /// + /// WMS交货数量 + /// + public decimal WMSDeliveryQty { set; get; } + /// /// WMS发货状态 /// @@ -93,8 +104,10 @@ namespace Win.Sfs.SettleAccount.Entities.WMSKanBan public virtual string State { get; set; } /// - /// 备注 + /// 出库单号 /// - public virtual string Remark { get; set; } + public string DeliveryOrderNo { set; get; } + + } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 0e1150fc..fff539fc 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -2406,6 +2406,21 @@ 仓储接口 缓存 + + + 有条码看板结算核对 + + + + + + + + + + + + 未结算对比 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 9af5b35b..44b45ffb 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 @@ -80,11 +80,22 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan /// public string State { set; get; } + /// /// WMS交货单 /// public string WMSDeliveryNote { set; get; } + /// + /// WMS实际发货日期 + /// + public string WMSActualGoodsDate { set; get; } + + /// + /// WMS交货数量 + /// + public decimal WMSDeliveryQty { set; get; } + /// /// WMS发货状态 /// @@ -95,6 +106,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan /// public string WMSKanBanState { set; get; } + /// + /// 出库单号 + /// + public string DeliveryOrderNo { 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 eee8cf69..4a9be170 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -66,6 +66,7 @@ using Win.Sfs.SettleAccount.Entities.VWKanBan; using Win.Sfs.SettleAccount.Entities.VWScrapClaims; using Win.Sfs.SettleAccount.Entities.VWSparePart; using Win.Sfs.SettleAccount.Entities.WMS_KanBan; +using Win.Sfs.SettleAccount.Entities.WMS_SparePart; namespace Win.Sfs.SettleAccount { @@ -315,7 +316,7 @@ namespace Win.Sfs.SettleAccount private static void ConfigureWMSSparePart(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => + builder.Entity(b => { b.ToTable($"{options.TablePrefix}_WMSSparePart", options.Schema); 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 31a9b7b7..f8fd418c 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 @@ -19,19 +19,44 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public virtual List GetSettleKBWithCodeReportList(string state, string version, string year,string customcode, string begintime, string endtime) { - string sqlString = " select " + string.Format(" {0} as Version , ", version) + " r1.ErpMaterialCode, r2.Price, r1.SumPrice , r1.MaterialDesc, (isnull(r2.Price,0)-isnull(r1.SumPrice,0)) as diffPrice from \n" + - "( select ErpMaterialCode, MaterialDesc, SUM(Price) as SumPrice from(\n" + - "select a.ErpMaterialCode, b.SettlementPartCode, a.MaterialDesc, (a.Qty * b.Price) as Price from\n" + - "(SELECT ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty, Version ,CustomerCode \n" + - "FROM [Set_MaterialRelationshipDetail] mdetail \n" + - - " where mdetail.Version='{0}' and mdetail.CustomerCode='{1}' \n" + - ") a \n" + - "inner join Set_settlement_part b on a.Version = b.Version and a.SettleMaterialCode = b.SettlementPartCode and a.CustomerCode = b.CustomerCode) temp group by ErpMaterialCode, MaterialDesc) r1 left join set_pricelist r2 " + - " on r2.MaterialCode=r1.ErpMaterialCode and r2.Version='{0}'\n"; - - string _sql = string.Format(sqlString, version, customcode); - + string sqlString = "SELECT\n" + + " * ,\n" + + " ISNULL( Price * WMSDeliveryQty, 0 ) AS Amount, --金额\n" + + " ISNULL( InvoicePrice * Qty, 0 ) AS SettleQty, --结算金额\n" + + " (Price-InvoicePrice) as InvoiceDiffPrice, --单价差异\n" + + " ISNULL( Price * Qty-InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异\n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " c.WMSDeliveryNote,--交货单号\n" + + " c.WMSActualGoodsDate,--实际发货日期\n" + + " a.Kanban,--条码号\n" + + " b.MaterialCode SapMaterialCode,--厂内物料号\n" + + " b.MaterialDesc,--物料描述\n" + + " b.CustomerPartCode,--客户物料\n" + + " b.EstimateTypeDesc,--物料组(车型)\n" + + " c.WMSDeliveryQty,--交货数量\n" + + " a.Qty AS SettleNumber,--结算数量\n" + + " a.SettleDate, --结算日期\n" + + " a.Qty,--用于计算\n" + + " (a.Qty-c.WMSDeliveryQty) as SettleWMSDiffQty,--结算与发货差异\n" + + " (a.Qty-a.Qty) as SettleInvoiceDiffQty,--结算与发货差异\n" + + " a.Qty AS InvoiceDiffQty, --开票数量,暂时等同于结算数量\n" + + " d.InvoicePrice,--开票单价\n" + + " (a.Qty * d.InvoicePrice) as InvoiceMoney, --开票金额\n" + + " c.DeliveryOrderNo --出库单号\n" + + " \n" + + " FROM\n" + + " Set_KanBanSettle AS a\n" + + " LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode\n" + + " LEFT JOIN Set_WMSKanBanSettle c ON a.Kanban= c.Kanban \n" + + " AND a.MaterialCode= c.MaterialCode\n" + + " LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '202109' GROUP BY materialcode ) d ON a.MaterialCode= d.MaterialCode \n" + + " ) TEMP1\n" + + " LEFT JOIN ( SELECT Price, --定价\n" + + " MaterialCode --厂内物料号\n" + + " FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SapMaterialCode= TEMP2.MaterialCode"; + string _sql = string.Format(sqlString, version); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); return _query.ToList(); @@ -61,13 +86,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string MaterialDesc { set; get; } [ExporterHeader(DisplayName = "客户物料")] - public string CustomerMaterial { set; get; } + public string CustomerPartCode { set; get; } [ExporterHeader(DisplayName = "物料组(车型)")] - public string Model { set; get; } + public string EstimateTypeDesc { set; get; } [ExporterHeader(DisplayName = "交货数量")] - public decimal WMSBillNum { set; get; } + public decimal WMSDeliveryQty { set; get; } [ExporterHeader(DisplayName = "定价")] public decimal Price { set; get; } @@ -90,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "结算与开票差异")] public decimal SettleInvoiceDiffQty { set; get; } - [ExporterHeader(DisplayName = "开票差量")] + [ExporterHeader(DisplayName = "开票数量")] public decimal InvoiceDiffQty { set; get; } [ExporterHeader(DisplayName = "开票单价")]