From c230c381d65c88a687c3b580fb1e3a7db7875b57 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 26 Nov 2021 16:35:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SettleKBWithCodeDapperReportRepository.cs | 2 +- .../SettleSparePartDapperReportRepository.cs | 62 +++++++++---------- .../SettleAccountJobModule.cs | 11 ++++ 3 files changed, 43 insertions(+), 32 deletions(-) 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 65f29f21..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 @@ -132,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 index 1b5f0691..b0d5e8db 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs @@ -20,37 +20,37 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report 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.WMSDeliveryNote \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 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(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs index 15c76cde..fc2529e4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs @@ -108,6 +108,17 @@ 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(); + } + else { throw new ArgumentException($"Not Support key:{key}");