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..e75ee765 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -6689,7 +6689,7 @@ namespace Win.Sfs.SettleAccount.Migrations .IsUnique() .HasFilter("IsDeleted=0"); - b.ToTable("Set_WMSSparePart"); + b.ToTable("Set_SparePart"); }); modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartVersion", b => @@ -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)"); @@ -6992,6 +7001,179 @@ namespace Win.Sfs.SettleAccount.Migrations b.ToTable("Set_WMSKanBanSettle_Version"); }); + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_SparePart.WMSSparePart", b => + { + b.Property("Id") + .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"); + + 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("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") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + 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)"); + + b.Property("ReceiptQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SpareDate") + .HasColumnType("datetime2"); + + b.Property("TaxCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Unit") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WMSDeliverGoodsState") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryNote") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSKanBanState") + .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"); + }); + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b => { b.Property("Id") 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/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index 363a208b..974c1c4a 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -73,7 +73,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices _service = service; } - #region 派格结算报表 + #region 派格大众看板-备件结算报表 /// /// 有条码看板结算核对 /// @@ -106,7 +106,45 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() }); customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() }); - var _taskid = await _service.ExportEnqueueAsync("未结算对比", ExportExtentsion.Excel, CurrentUser, typeof(UnSettledExportService), customConditionList, (rs) => + var _taskid = await _service.ExportEnqueueAsync("大众看板结算与交货核对明细表", ExportExtentsion.Excel, CurrentUser, typeof(SettleKBWithCodeExportService), customConditionList, (rs) => + { + }); + return _taskid; + } + + /// + /// 大众备件结算核对明细表 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [HttpGet] + [Route("SettlSparePartExport")] + [DisableRequestSizeLimit] + + public async Task SettledSparePart(string year, string period, string version, string customerCode, string factory, string matialCode, + string state, DateTime begin, DateTime end) + { + + List customConditionList = new List(); + customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" }); + customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" }); + customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" }); + customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() }); + customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() }); + + var _taskid = await _service.ExportEnqueueAsync("大众备件结算核对明细表", ExportExtentsion.Excel, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) => { }); return _taskid; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 38bb8d13..d3e17e57 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -2421,6 +2421,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.Domain/Entities/WMS-SparePart/WMSSparePart.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-SparePart/WMSSparePart.cs index 6497f2c3..693a5871 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 @@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart /// /// 期间 /// - [Display(Name = "期间")] + [Display(Name = "交货日期")] public string Period { set; get; } /// /// 版本号 @@ -105,7 +105,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart /// /// 收货数量 /// - [Display(Name = "收货数量")] + [Display(Name = "发货数量")] public decimal ReceiptQty { get; set; } /// @@ -141,7 +141,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart /// /// 日期 /// - [Display(Name = "日期")] + [Display(Name = "订单日期")] public DateTime SpareDate { get; set; } /// /// 交货单号 @@ -195,7 +195,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_SparePart public string Extend { set; get; } /// - /// WMS交货单 + /// WMS采购订单号 /// public string WMSDeliveryNote { 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..314c15b9 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,45 @@ 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 +87,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 +116,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 = "开票单价")] @@ -106,7 +132,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public decimal SumDiffMoney { set; get; } [ExporterHeader(DisplayName = "出库单号")] - public decimal DeliveryOrderNo { set; get; } + public string DeliveryOrderNo { set; get; } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs new file mode 100644 index 00000000..b0d5e8db --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs @@ -0,0 +1,116 @@ +using Dapper; +using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories.Dapper; +using Volo.Abp.EntityFrameworkCore; + +namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report +{ + public class SettleSparePartDapperReportRepository : DapperRepository, ITransientDependency + { + public SettleSparePartDapperReportRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { } + + public virtual List GetSettleSparePartReportList(string state, string version, string year, string customcode, + string begintime, string endtime) + { + string sqlString = " SELECT \n" + + " * , \n" + + " (Price-InvoicePrice) as InvoiceDiffPrice, --单价差异 \n" + + " ISNULL( Price * ReceiptQty-InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异 \n" + + " FROM \n" + + " ( \n" + + " SELECT \n" + + " c.Period as WMSDeliveryDate,--交货日期 \n" + + " c.DeliveryOrderNo,--交货单号 \n" + + " c.SpareDate as OrderDate,--订单日期 \n" + + " a.PurchaseOrderNo,--采购订单号 \n" + + " b.MaterialCode as SAPCode,--SAP编码,即厂内物料号 \n" + + " a.MaterialCode,--物料代码 \n" + + " b.MaterialDesc,--物料描述 \n" + + " a.PurchaseOrderNoText,--采购订单文本 \n" + + " c.ReceiptQty,-- 发货数量 \n" + + " d.Amt as InvoicedQty,--开票数量 \n" + + " (c.ReceiptQty-d.Amt) as SettleInvoiceDiffQty,--发货与开票差异 \n" + + " d.InvoicePrice,--开票单价 \n" + + " (a.ReceiptQty * d.InvoicePrice) as InvoiceMoney --开票金额 \n" + + " \n" + + " FROM \n" + + " Set_SparePart AS a \n" + + " LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode \n" + + " LEFT JOIN Set_WMSSparePart c ON a.PurchaseOrderNo= c.PurchaseOrderNo \n" + + " AND a.MaterialCode= c.MaterialCode \n" + + " LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode,Amt FROM set_invoice WHERE version = '202109' GROUP BY materialcode,Amt ) 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.SAPCode= TEMP2.MaterialCode "; + string _sql = string.Format(sqlString, version); + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + return _query.ToList(); + + } + + } + + /// + /// 大众看板有条码报表 + /// + //[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)] + public class SettleSparePartExport + { + [ExporterHeader(DisplayName = "交货日期")] + public string WMSDeliveryDate { set; get; } + + [ExporterHeader(DisplayName = "交货单号")] + public string DeliveryOrderNo { set; get; } + + [ExporterHeader(DisplayName = "订单日期")] + public DateTime OrderDate{ set; get; } + + [ExporterHeader(DisplayName = "采购订单号")] + public string PurchaseOrderNo { set; get; } + + [ExporterHeader(DisplayName = "SAP编码")] + public string SAPCode { set; get; } + + [ExporterHeader(DisplayName = "物料代码")] + public string MaterialCode { set; get; } + + [ExporterHeader(DisplayName = "物料描述")] + public string MaterialDesc { set; get; } + + [ExporterHeader(DisplayName = "采购订单文本")] + public string PurchaseOrderNoText { set; get; } + + [ExporterHeader(DisplayName = "发货数量")] + public decimal ReceiptQty { set; get; } + + [ExporterHeader(DisplayName = "开票数量")] + public decimal InvoicedQty { set; get; } + + [ExporterHeader(DisplayName = "发货与开票差异")] + public decimal SettleInvoiceDiffQty { set; get; } + + [ExporterHeader(DisplayName = "开票单价")] + public decimal InvoicePrice { set; get; } + + [ExporterHeader(DisplayName = "开票金额")] + public decimal InvoiceMoney { set; get; } + [ExporterHeader(DisplayName = "定价")] + public decimal Price { set; get; } + + [ExporterHeader(DisplayName = "单价差异")] + public decimal InvoiceDiffPrice { set; get; } + + [ExporterHeader(DisplayName = "总金额差异")] + public decimal SumDiffMoney { set; get; } + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs new file mode 100644 index 00000000..6acfc899 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TaskJob.EventArgs; +using TaskJob.Interfaces; +using Volo.Abp.DependencyInjection; +using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; + +namespace SettleAccount.Job.Services.Report +{ + public class SettleSparePartExportService : ITransientDependency, IExportJob + { + private readonly SettleSparePartDapperReportRepository _dapper; + private readonly OutputService _outputService; + + public SettleSparePartExportService(SettleSparePartDapperReportRepository dapper, OutputService outputService) + { + _dapper = dapper; + _outputService = outputService; + } + + + public string ExportFile(Guid id, List exportName, List p_list) + { + var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value; + var state = p_list.Where(p => p.Name == "State").FirstOrDefault().Value; + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; + var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; + var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value; + var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; + + var _list = _dapper.GetSettleSparePartReportList(state, version, year, customerCode, beginTime, endTime); + + _outputService.Export(id, string.Format("大众备件结算核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _list); + + return id.ToString(); + } + + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs index 3bd2f36b..da7ea0d6 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs @@ -107,6 +107,18 @@ namespace Win.Sfs.SettleAccount { return implementationFactory.GetService(); } + + //大众看板结算与交货核对明细表(有条码) + if (key.Equals(typeof(SettleKBWithCodeExportService).FullName)) + { + return implementationFactory.GetService(); + } + //大众备件结算核对明细表 + if (key.Equals(typeof(SettleSparePartExportService).FullName)) + { + return implementationFactory.GetService(); + } + if (key.Equals(typeof(InvoiceSettledDetailDiffExportService).FullName)) { return implementationFactory.GetService(); diff --git a/vue/src/router/index.js b/vue/src/router/index.js index 0f52e00e..84ce41c9 100644 --- a/vue/src/router/index.js +++ b/vue/src/router/index.js @@ -11,7 +11,7 @@ import { managerRouter } from './modules/manager' import personRouter from './modules/person' import basedataRouter from './modules/basedata' import billdataRouter from './modules/vwKBdata' -import businessdataRouter from './modules/businessdata' +//import businessdataRouter from './modules/businessdata' import vwFisDataRouter from './modules/vwFisData' import wheeldataRouter from './modules/wheeldata' import vwNoBarcodeRouter from './modules/vwKBNoBarcodedata' @@ -172,8 +172,9 @@ export const asyncRoutes = [ //newjitRouter,//FIS数据管理 vwFisDataRouter,//结算与开票数据导入 billdataRouter,//销售结算与开票报表 + //businessdataRouter, + wheeldataRouter,//大众看板和备件 pgfis,//派格fis - //wheeldataRouter,//二配 JobTimeDataRouter,//后台作业监控 // 404 page must be placed at the end !!! diff --git a/vue/src/router/modules/basedata.js b/vue/src/router/modules/basedata.js index 4d6d0346..7709d2af 100644 --- a/vue/src/router/modules/basedata.js +++ b/vue/src/router/modules/basedata.js @@ -2,7 +2,7 @@ import Layout from '@/layout' const basedataRouter = { - path: '/prebatch', + path: '/cpat/base', component: Layout, redirect: 'basedata', name: '基础数据维护', @@ -17,7 +17,7 @@ const basedataRouter = { }, children: [ { - path: '/centralizedControl', + path: 'date-control', component: () => import('@/views/ux/basedata/centralizedControl/index'), name: 'CentralizedControl',//命名路由 meta: { @@ -27,29 +27,19 @@ const basedataRouter = { } }, { - path: '/material', + path: 'material', component: () => import('@/views/ux/basedata/material/index'), name: 'material',//命名路由 meta: { title: '物料主数据', roles: ['SettleAccount.Materials'], icon: '物料' } }, { - path: '/codeSetting', + path: 'code-setting', component: () => import('@/views/ux/basedata/codeSetting/index'), name: 'codeSetting',//命名路由 meta: { title: '通用代码设置', roles: ['SettleAccount.CodeSettings'], icon: '通用' } }, - // { - // path: '/settlementParts', - // component: () => import('@/views/ux/basedata/settlementParts/index'), - // name: 'settlementParts',//命名路由 - // meta: { - // title: '结算件基本信息', - // roles: ['SettleAccount.SettlementParts'], - // icon: '零件' - // } - // }, { - path: '/partsSettlement', + path: 'part-settlement', component: () => import('@/views/ux/basedata/partsSettlement/index'), name: 'partsSettlement',//命名路由 meta: { @@ -69,37 +59,25 @@ const basedataRouter = { } }, { - path: 'invoiceBatch', - component: () => import('@/views/ux/basedata/Prebatch/index'), - name: 'Prebatch',//命名路由 + path: 'wms-kanban', + component: () => import('@/views/ux/vw/dataInput/wmsKanban'), + name: 'WMSVWKanBan', meta: { - title: '客户信息管理', - roles: ['SettleAccount.Prebatchs'], - icon: '批量' + title: '大众看板发货明细', + roles: ['SettleAccount.Reports'], + icon: '供货' } - }, - - // { - // path: 'bomdatabase', - // component: () => import('@/views/ux/basedata/bomdatabase/index'), - // name: 'Bomdatabase',//命名路由 - // meta: { - // title: 'BOM', - // roles: ['SettleAccount.Boms'], - // icon: '未结算' - // } - // }, - - // { - // path: '/settlementPakAndSparePartsRef', - // component: () => import('@/views/ux/basedata/settlementPakAndSparePartsRef/index'), - // name: 'settlementPakAndSparePartsRef',//命名路由 - // meta: { - // title: '结算包与散件对应关系', - // roles: ['SettleAccount.Boms'], - // icon: '零件' - // } - // }, + }, + { + path: 'wms-sparepart', + component: () => import('@/views/ux/vw/dataInput/wmsSparePart'), + name: 'WMSSparePart',//命名路由 + meta: { + title: '大众备件发货明细', + roles: ['SettleAccount.Reports'], + icon: '客户零件' + } + } ] } diff --git a/vue/src/router/modules/businessdata.js b/vue/src/router/modules/businessdata.js index b4b10c21..74bedc2a 100644 --- a/vue/src/router/modules/businessdata.js +++ b/vue/src/router/modules/businessdata.js @@ -3,55 +3,55 @@ import Layout from '@/layout' const businessdataRouter = { - path: '/vw-sparepart-js', + path: '/wms-js', component: Layout, - redirect: 'vw-sparepart-js', + redirect: 'wms-js', name: '大众备件结算', meta: { //requiresAuth: true, - title: '大众备件结算', + title: '大众看板备件发货', index: 0, type: 'crm', icon: '业务', keepAlive: false, }, children: [ + // { + // path: '/yu-fahuo-kb', + // component: () => import('@/views/ux/businessdata/deliverGoodsDrag'), + // name: 'jfcarkb',//命名路由 + // meta: { + // title: '结算与开票数据对比', + // roles: ['SettleAccount.Reports'], + // icon: '发货' + // } + // }, + // { + // path: '/jf-car-kb', + // component: () => import('@/views/ux/businessdata/deliverGoods'), + // name: 'jfcarkb',//命名路由 + // meta: { + // title: '备件发出未结算数据', + // roles: ['SettleAccount.Reports'], + // icon: '发货' + // } + // }, { - path: '/yu-fahuo-kb', - component: () => import('@/views/ux/businessdata/deliverGoodsDrag'), - name: 'jfcarkb',//命名路由 + path: '/wms-kanban', + component: () => import('@/views/ux/vw/dataInput/wmsKanban'), + name: 'WMSVWKanBan', meta: { - title: '结算与开票数据对比', - roles: ['SettleAccount.Reports'], - icon: '发货' - } - }, - { - path: '/jf-car-kb', - component: () => import('@/views/ux/businessdata/deliverGoods'), - name: 'jfcarkb',//命名路由 - meta: { - title: '备件发出未结算数据', - roles: ['SettleAccount.Reports'], - icon: '发货' - } - }, - { - path: '/jf-car-consign', - component: () => import('@/views/ux/businessdata/supplyGap'), - name: 'JFCarConsign', - meta: { - title: '定价与结算单价对比', + title: '大众看板发货明细', roles: ['SettleAccount.Reports'], icon: '供货' } }, { - path: '/settlement', - component: () => import('@/views/ux/billManage/FisUnSettledDiff'), - name: 'FisUnSettledDiff',//命名路由 + path: '/wms-sparepart', + component: () => import('@/views/ux/vw/dataInput/wmsSparePart'), + name: 'WMSSparePart',//命名路由 meta: { - title: '开票汇总数据', + title: '大众备件发货明细', roles: ['SettleAccount.Reports'], icon: '客户零件' } diff --git a/vue/src/router/modules/vwFisData.js b/vue/src/router/modules/vwFisData.js index 36b90e97..b7e65281 100644 --- a/vue/src/router/modules/vwFisData.js +++ b/vue/src/router/modules/vwFisData.js @@ -9,7 +9,7 @@ const vwFisDataRouter = { //hidden: true, meta: { //requiresAuth: true, - title: '大众结算与开票数据导入', + title: '大众结算与开票导入', index: 0, type: 'crm', icon: '单据导入', diff --git a/vue/src/router/modules/vwKBdata.js b/vue/src/router/modules/vwKBdata.js index 4ca36bf7..53dfc510 100644 --- a/vue/src/router/modules/vwKBdata.js +++ b/vue/src/router/modules/vwKBdata.js @@ -9,7 +9,7 @@ const billdataRouter = { //hidden: true, meta: { //requiresAuth: true, - title: '大众销售结算与开票报表', + title: '大众结算与开票报表', index: 0, type: 'crm', icon: '销售', diff --git a/vue/src/router/modules/wheeldata.js b/vue/src/router/modules/wheeldata.js index 5e9ce17d..b6952155 100644 --- a/vue/src/router/modules/wheeldata.js +++ b/vue/src/router/modules/wheeldata.js @@ -1,15 +1,15 @@ -/** 车轮数据比对路由 */ +/**大众看板、备件数据比对路由 */ //import Layout from '@/layout/firstLayout' import Layout from '@/layout' const wheeldataRouter = { - path: '/wheeldata', + path: '/cpat/report', component: Layout, - redirect: 'wheeldata',//重定向 + redirect: 'cpat',//重定向 name: 'WheelData', meta: { // requiresAuth: true, - title: '二次配套比对', + title: '大众看板、备件报表', //index: 0, // type: 'crm', icon: '对比', @@ -18,22 +18,22 @@ const wheeldataRouter = { }, children: [ { - path: '/unSettleAccount', - component: () => import('@/views/ux/vw/dataInput/unSettleAccount'), - name: 'UnSettleAccount',//命名路由 + path: 'kbwithcode', + component: () => import('@/views/ux/billManage/kanBanWithCode'), + name: 'KanBanWithCode',//命名路由 meta: { - title: '二次配套比对报表', + title: '大众看板结算与交货核对', //roles: ['SettleAccount.EstimatedStockDiffReports'],//控制页面角色(可以设置多个角色) icon: '对比' } }, { - path: '/twojs', - component: () => import('@/views/ux/billManage/FisUnSettledDiff'), - name: 'twojs',//命名路由 + path: 'vwsparepart', + component: () => import('@/views/ux/billManage/sparePart'), + name: 'SparePartReport',//命名路由 meta: { - title: '二次配套结算', + title: '大众备件结算核对', //roles: ['abpvnext_master.ProjectPeople'],//控制页面角色(可以设置多个角色) icon: '二配' } diff --git a/vue/src/views/pg-fis/basedate/customerPartCfg/index.vue b/vue/src/views/pg-fis/basedate/customerPartCfg/index.vue index fad25f00..ab16bbcc 100644 --- a/vue/src/views/pg-fis/basedate/customerPartCfg/index.vue +++ b/vue/src/views/pg-fis/basedate/customerPartCfg/index.vue @@ -468,14 +468,10 @@ export default { } */ if(column.property === "partType") { - if(row[column.property] === "1") + var pl = this.partType1List.filter(u => u.dicItemCode === row[column.property]); + if(pl.length !== 0) { - var vname = '门板'; - return vname; - } - else if(row[column.property] === '2') - { - var vname = '柱护板'; + var vname = pl[0].dicItemName; return vname; } else diff --git a/vue/src/views/pg-fis/basedate/m100BIll/detail.vue b/vue/src/views/pg-fis/basedate/m100BIll/detail.vue index 25108fdd..35119046 100644 --- a/vue/src/views/pg-fis/basedate/m100BIll/detail.vue +++ b/vue/src/views/pg-fis/basedate/m100BIll/detail.vue @@ -184,15 +184,15 @@ export default { formTitle: "", drawer: false, showExcelImport: false, - tableHeight: document.documentElement.clientHeight - 260, - isEdit: false, + tableHeight: document.documentElement.clientHeight -30 , + isEdit: false }; }, mounted() { var self = this; window.onresize = function () { var offsetHei = document.documentElement.clientHeight; - self.tableHeight = offsetHei - 190; + self.tableHeight = offsetHei - 30; }; }, created() { diff --git a/vue/src/views/pg-fis/basedate/m100Online/index.vue b/vue/src/views/pg-fis/basedate/m100Online/index.vue index 26d182b4..d71b3e2d 100644 --- a/vue/src/views/pg-fis/basedate/m100Online/index.vue +++ b/vue/src/views/pg-fis/basedate/m100Online/index.vue @@ -197,25 +197,28 @@ >导出(Excel) 打印发货排序单 + >打印门板发货排序单 重新打印发货排序单 + >重新打印门板发货排序单 补打发货排序单 + >补打门板发货排序单 @@ -276,6 +279,81 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +