From 1bffb61c0bc59bbca84a52f06456e5795c8a154e Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Sat, 2 Apr 2022 20:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E4=BC=97=E5=A4=87=E4=BB=B6=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=BE=93=E5=87=BA=E8=B0=83=E6=95=B4=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HQFactorySettledDetailDapperRepository.cs | 2 +- .../HQHSettledDetailDapperRepository.cs | 3 - .../SettleKBWithCodeDapperReportRepository.cs | 2 +- ...SettleSparePart90DapperReportRepository.cs | 125 +++- .../SettleSparePartDapperReportRepository.cs | 593 +++++++++++++----- .../Report/SettleSparePart90ExportService.cs | 2 +- 6 files changed, 555 insertions(+), 172 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs index f2d90bd9..297dcede 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs @@ -179,7 +179,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AND temp1.订货看板编号 = tt.Code \n" + " ) UNION2 \n" + " ) AS temp1 ON unhq.HQHKanBan = temp1.[订货看板编号] \n" + - " AND unhq.CustomerPartCode= temp1.客户物料号 \n" + + " AND unhq.CustomerPartCode= temp1.客户物料号 WHERE temp1.[订货看板编号] is null and temp1.客户物料号 is null \n" + " ) temp3\n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp3.MaterialCode = TEMP2.MaterialCode"; diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs index 15b0c1fe..a6ebf6dc 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs @@ -57,8 +57,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report List _list = new List(); - - //string condition = " "; //if (!string.IsNullOrEmpty(begin)) @@ -70,7 +68,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // condition += string.Format(" and b.LastModificationTime<='{0}' ", end); //} - string str = "SELECT\n" + " isnull( temp1.交货单号, '' ) 交货单号,\n" + 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 389963bc..d93fcf81 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 @@ -87,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " (\n" + " ( SELECT SUM ( WMSDeliveryQty ) Qty, KanBan, MaterialCode FROM Set_WMSKanBanSettle GROUP BY KanBan, MaterialCode ) temp1\n" + " LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_KanBanSettle WHERE VERSION < '{0}' GROUP BY kanban, MaterialCode ) temp2 ON temp1.Kanban = temp2.KanBan \n" + - " AND temp1.MaterialCode = temp2.KanBan \n" + + " AND temp1.MaterialCode = temp2.MaterialCode \n" + " ) \n" + " ) C ON A.Kanban = C.Kanban \n" + " AND A.MaterialCode = C.MaterialCode\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs index 91a844ef..d204ec62 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs @@ -12,7 +12,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { /// - /// 根据虚拟单号0-90天的是按照SAP物料号进行先进先出操作 + /// 大众备件明细输出, /// public class SettleSparePart90DapperReportRepository : DapperRepository, ITransientDependency { @@ -21,7 +21,113 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { } + /// + /// 大众备件数据调整:期初没有WMS发运数据,调整的数据就是给WMS一份,给结算一份 + /// + /// + /// + /// + /// + /// + /// + /// public virtual List GetSettleSparePart90ReportList(string purchaseOrderNo, string version, string sapCode, string matialCode, + string begintime, string endtime) + { + string sqlString = "SELECT\n" + + " temp1.交货日期,\n" + + " temp1.交货单号,\n" + + " '' 订单日期,\n" + + " temp1.采购订单号,\n" + + " temp1.SAP编码,\n" + + " temp1.物料代码,\n" + + " temp1.物料描述,\n" + + " temp1.采购订单文本,\n" + + " temp1.发货数量,\n" + + " temp1.开票数量,\n" + + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 发货与开票差异,\n" + + " temp1.开票单价,\n" + + " ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" + + " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + + " temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + + " ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额 \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " a.Version AS 期间,\n" + + " a.PurchaseOrderNoText AS 采购订单文本,\n" + + " b.WMSDeliveryNote AS 交货单号,\n" + + " b.SpareDate AS 交货日期,\n" + + " a.PurchaseOrderNo AS 采购订单号,\n" + + " c.MaterialCode AS SAP编码,\n" + + " b.MaterialCode AS 物料代码,\n" + + " c.MaterialDesc AS 物料描述,\n" + + " c.EstimateTypeDesc AS 物料组,\n" + + " a.PurchasePriceNoTax AS 开票单价,\n" + + " 0 AS 数量差异,\n" + + " ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" + + " ISNULL( a.InvoicedQty, 0 ) AS 开票数量 ,\n" + + " ISNULL( a.AmountNoTax, 0 ) AS 开票金额 \n" + + " FROM\n" + + " (\n" + + " SELECT SUM\n" + + " ( ReceiptQty ) AS ReceiptQty,\n" + + " PurchaseOrderNo,\n" + + " MaterialCode,\n" + + " Version,\n" + + " PurchasePriceNoTax,\n" + + " InvoicedQty,\n" + + " PurchaseOrderNoText,\n" + + " AmountNoTax \n" + + " FROM\n" + + " Set_SparePart where Extend='is90' \n" + + " GROUP BY\n" + + " PurchaseOrderNo,\n" + + " MaterialCode,\n" + + " Version,\n" + + " PurchasePriceNoTax,\n" + + " InvoicedQty,\n" + + " PurchaseOrderNoText,\n" + + " AmountNoTax \n" + + " ) AS a\n" + + " INNER JOIN (\n" + + " SELECT SUM\n" + + " ( ReceiptQty ) AS ReceiptQty,\n" + + " PurchaseOrderNo,\n" + + " SapCode,\n" + + " MaterialCode,\n" + + " WMSDeliveryNote,\n" + + " SpareDate \n" + + " FROM\n" + + " Set_WMSSparePart \n" + + " GROUP BY\n" + + " PurchaseOrderNo,\n" + + " SapCode,\n" + + " MaterialCode,\n" + + " WMSDeliveryNote,\n" + + " SpareDate \n" + + " ) AS b ON a.PurchaseOrderNo = b.PurchaseOrderNo \n" + + " AND a.MaterialCode = b.MaterialCode\n" + + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + + " WHERE\n" + + " ( a.Version = '{0}' ) \n" + + " ) AS temp1\n" + + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + + "ORDER BY\n" + + " temp1.采购订单号"; + + string addwhere = string.Empty; + string addSqlStr = string.Format(sqlString, version); + + string _sql = string.Format(addSqlStr, addwhere); + //string _sql = string.Format(sqlString, version); + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + return _query.ToList(); + + } + + + public virtual List GetSettleSparePart90ReportList_old(string purchaseOrderNo, string version, string sapCode, string matialCode, string begintime, string endtime) { string sqlString = "SELECT\n" + @@ -70,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " PurchaseOrderNoText,\n" + " AmountNoTax \n" + " FROM\n" + - " Set_SparePart \n" + + " Set_SparePart where Extend='is90' \n" + " GROUP BY\n" + " PurchaseOrderNo,\n" + " MaterialCode,\n" + @@ -116,7 +222,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - + /// + /// 大众备件未结明细 + /// + /// + /// + /// + /// + /// + /// + /// public virtual List GetUnSettleSparePart90ReportList(string purchaseOrderNo, string version, string sapCode, string matialCode, string begintime, string endtime) { @@ -156,7 +271,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ISNULL( b.AmountNoTax, 0 ) AS 开票金额 \n" + " FROM\n" + " Set_WMSSparePart a\n" + - " LEFT JOIN ( SELECT PurchaseOrderNo, Version, PurchaseOrderNoText, PurchasePriceNoTax, InvoicedQty, AmountNoTax FROM Set_SparePart WHERE Version = '{0}' ) b ON a.PurchaseOrderNo = b.PurchaseOrderNo\n" + + " LEFT JOIN ( SELECT PurchaseOrderNo, Version, PurchaseOrderNoText, PurchasePriceNoTax, InvoicedQty, AmountNoTax FROM Set_SparePart WHERE Version = '{0}' and Extend='is90' ) b ON a.PurchaseOrderNo = b.PurchaseOrderNo\n" + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " WHERE\n" + " b.PurchaseOrderNo IS NULL \n" + @@ -183,7 +298,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // " a.PurchaseOrderNo 订单号,\n" + // " a.MaterialCode 物料号 \n" + // "FROM\n" + - // " ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Version = '{0}' GROUP BY PurchaseOrderNo, MaterialCode ) A\n" + + // " ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Version = '{0}' and Extend='is90' GROUP BY PurchaseOrderNo, MaterialCode ) A\n" + // " LEFT JOIN ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart GROUP BY PurchaseOrderNo, MaterialCode ) B ON A.MaterialCode = B.MaterialCode \n" + // " AND A.PurchaseOrderNo = B.PurchaseOrderNo \n" + // "WHERE\n" + 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 5ff95b24..72b2e19c 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 @@ -18,12 +18,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { } - //public async Task SettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode, - //string state, DateTime begin, DateTime end) - + /// - /// 带采购订单号和无订单号一起统计报表 WHERE Extend != 'is90' + /// 带采购订单号和无订单号一起统计报表 WHERE Extend != 'is90' 去掉 备件调整数据 /// /// /// @@ -36,163 +34,424 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string begintime, string endtime) { string sqlString = "SELECT\n" + - " union1.* \n" + - "FROM\n" + - " (\n" + - " SELECT\n" + - " temp1.交货日期,\n" + - " temp1.交货单号,\n" + - " '' 订单日期,\n" + - " temp1.采购订单号,\n" + - " temp1.SAP编码,\n" + - " temp1.物料代码,\n" + - " temp1.物料描述,\n" + - " temp1.采购订单文本,\n" + - " temp1.发货数量,\n" + - " temp1.开票数量,\n" + - " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 发货与开票差异,\n" + - " temp1.开票单价,\n" + - " ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" + - " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + - " temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + - " ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额 \n" + - " FROM\n" + - " (\n" + - " SELECT\n" + - " a.Version AS 期间,\n" + - " a.PurchaseOrderNoText AS 采购订单文本,\n" + - " b.WMSDeliveryNote AS 交货单号,\n" + - " b.SpareDate AS 交货日期,\n" + - " a.PurchaseOrderNo AS 采购订单号,\n" + - " c.MaterialCode AS SAP编码,\n" + - " b.MaterialCode AS 物料代码,\n" + - " c.MaterialDesc AS 物料描述,\n" + - " c.EstimateTypeDesc AS 物料组,\n" + - " a.PurchasePriceNoTax AS 开票单价,\n" + - " 0 AS 数量差异,\n" + - " ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" + - " ISNULL( a.InvoicedQty, 0 ) AS 开票数量 ,\n" + - " ISNULL( a.AmountNoTax, 0 ) AS 开票金额 \n" + - " FROM\n" + - " (\n" + - " SELECT SUM\n" + - " ( ReceiptQty ) AS ReceiptQty,\n" + - " PurchaseOrderNo,\n" + - " MaterialCode,\n" + - " Version,\n" + - " PurchasePriceNoTax,\n" + - " InvoicedQty,\n" + - " PurchaseOrderNoText,\n" + - " AmountNoTax \n" + - " FROM\n" + - " Set_SparePart WHERE Extend != 'is90' \n" + - " GROUP BY\n" + - " PurchaseOrderNo,\n" + - " MaterialCode,\n" + - " Version,\n" + - " PurchasePriceNoTax,\n" + - " InvoicedQty,\n" + - " PurchaseOrderNoText,\n" + - " AmountNoTax \n" + - " ) AS a\n" + - " INNER JOIN (\n" + - " SELECT SUM\n" + - " ( ReceiptQty ) AS ReceiptQty,\n" + - " PurchaseOrderNo,\n" + - " SapCode,\n" + - " MaterialCode,\n" + - " WMSDeliveryNote,\n" + - " SpareDate \n" + - " FROM\n" + - " Set_WMSSparePart \n" + - " GROUP BY\n" + - " PurchaseOrderNo,\n" + - " SapCode,\n" + - " MaterialCode,\n" + - " WMSDeliveryNote,\n" + - " SpareDate \n" + - " ) AS b ON a.PurchaseOrderNo = b.PurchaseOrderNo \n" + - " AND a.MaterialCode = b.MaterialCode\n" + - " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + - " WHERE\n" + - " ( a.Version = '{0}' ) \n" + - " ) AS temp1\n" + - " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + - " ) union1 UNION ALL\n" + - "SELECT\n" + - " union2.* \n" + - "FROM\n" + - " (\n" + - " SELECT\n" + - " temp1.交货日期,\n" + - " '' 交货单号,\n" + - " '' 订单日期,\n" + - " '' 采购订单号,\n" + - " temp1.SAP编码,\n" + - " temp1.物料代码,\n" + - " temp1.物料描述,\n" + - " temp1.采购订单文本,\n" + - " temp1.发货数量,\n" + - " temp1.开票数量,\n" + - " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 发货与开票差异,\n" + - " temp1.开票单价,\n" + - " ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" + - " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + - " temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + - " ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额 \n" + - " FROM\n" + - " (\n" + - " SELECT\n" + - " a.Version AS 期间,\n" + - " '' AS 采购订单文本,\n" + - " NULL AS 交货日期,\n" + - " c.MaterialCode AS SAP编码,\n" + - " a.MaterialCode AS 物料代码,\n" + - " c.MaterialDesc AS 物料描述,\n" + - " c.EstimateTypeDesc AS 物料组,\n" + - " a.PurchasePriceNoTax AS 开票单价,\n" + - " 0 AS 数量差异,\n" + - " ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" + - " ISNULL( a.ReceiptQty, 0 ) AS 开票数量 ,\n" + - " ISNULL( a.ReceiptQty, 0 ) * ISNULL( a.PurchasePriceNoTax, 0 ) AS 开票金额 \n" + - " FROM\n" + - " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, MaterialCode, Version, PurchasePriceNoTax FROM Set_SparePart WHERE Extend != 'is90' GROUP BY MaterialCode, Version, PurchasePriceNoTax ) AS a\n" + - " LEFT JOIN ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, SapCode, MaterialCode FROM Set_WMSSparePart GROUP BY SapCode, MaterialCode ) AS b ON a.MaterialCode = b.MaterialCode\n" + - " LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" + - " WHERE\n" + - " ( a.Version = '{0}' ) \n" + - " ) AS temp1\n" + - " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + - " ) union2"; - - //" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp.Sap编码 = TEMP2.MaterialCode\n" + - string addwhere = string.Empty; - string addSqlStr = string.Format(sqlString, version); + " union1.* \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " temp1.交货日期,\n" + + " temp1.交货单号,\n" + + " NULL 订单日期,\n" + + " temp1.采购订单号,\n" + + " temp1.SAP编码,\n" + + " temp1.物料代码,\n" + + " temp1.物料描述,\n" + + " temp1.采购订单文本,\n" + + " temp1.收货数量,\n" + + " temp1.开票数量,\n" + + " ISNULL( temp1.收货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 收货与开票差异,\n" + + " temp1.开票单价,\n" + + " ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" + + " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + + " temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + + " ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额,\n" + + " temp1.交货数量,\n" + + " temp1.收货与交货差异,\n" + + " ISNULL( temp1.交货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" + + " ISNULL( temp3.Qty, 0 ) 退货数量 \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " a.Version AS 期间,\n" + + " a.PurchaseOrderNoText AS 采购订单文本,\n" + + " '' AS 交货单号,\n" + + " NULL AS 交货日期,\n" + + " a.PurchaseOrderNo AS 采购订单号,\n" + + " b.MaterialCode AS SAP编码,\n" + + " b.CustomerPartCode AS 物料代码,\n" + + " b.MaterialDesc AS 物料描述,\n" + + " b.EstimateTypeDesc AS 物料组,\n" + + " ISNULL( a.PurchasePriceNoTax, 0 ) AS 开票单价,\n" + + " ISNULL( a.ReceiptQty, 0 ) AS 收货数量,\n" + + " ISNULL( a.InvoicedQty, 0 ) AS 开票数量 ,\n" + + " ISNULL( a.InvoicedQty, 0 ) * ISNULL( a.PurchasePriceNoTax, 0 ) AS 开票金额,\n" + + " ISNULL( C.WMSDeliveryQty, 0 ) AS 交货数量,\n" + + " ( ISNULL( a.ReceiptQty, 0 ) - ISNULL( C.WMSDeliveryQty, 0 ) ) AS 收货与交货差异 \n" + + " FROM\n" + + " ( SELECT * FROM Set_SparePart WHERE Extend != 'is90' ) AS a\n" + + " LEFT OUTER JOIN Set_material AS b ON a.MaterialCode = b.CustomerPartCode\n" + + " LEFT JOIN (\n" + + "   SELECT\n" + + " ( ISNULL( temp1.Qty, 0 ) - ISNULL( temp2.Qty, 0 ) ) WMSDeliveryQty,\n" + + " temp1.MaterialCode,\n" + + " temp1.PurchaseOrderNo \n" + + " FROM\n" + + " (\n" + + " ( SELECT SUM ( ReceiptQty ) Qty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart GROUP BY PurchaseOrderNo, MaterialCode ) temp1\n" + + " LEFT JOIN ( SELECT SUM ( ReceiptQty ) Qty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE VERSION < '{0}' AND Extend != 'is90' GROUP BY PurchaseOrderNo, MaterialCode ) temp2 ON temp1.PurchaseOrderNo = temp2.PurchaseOrderNo \n" + + " AND temp1.MaterialCode = temp2.MaterialCode \n" + + " ) \n" + + " ) C ON A.PurchaseOrderNo = C.PurchaseOrderNo \n" + + " AND A.MaterialCode = C.MaterialCode \n" + + " WHERE\n" + + " ( a.Version = '{0}' ) \n" + + " ) AS temp1\n" + + " LEFT JOIN ( SELECT * FROM set_backQty WHERE Version = '{0}' ) temp3 ON temp1.采购订单号 = temp3.Code \n" + + " AND temp1.SAP编码= temp3.MaterialCode\n" + + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + + " ) union1 UNION ALL\n" + + "SELECT\n" + + " union2.* \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " temp1.交货日期,\n" + + " '' 交货单号,\n" + + " '' 订单日期,\n" + + " '' 采购订单号,\n" + + " temp1.SAP编码,\n" + + " temp1.物料代码,\n" + + " temp1.物料描述,\n" + + " '' 采购订单文本,\n" + + " temp1.收货数量,\n" + + " temp1.开票数量,\n" + + " ISNULL( temp1.收货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 发货与开票差异,\n" + + " temp1.开票单价,\n" + + " ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" + + " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + + " temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + + " ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额,\n" + + " 0 交货数量,\n" + + " 0 收货与交货差异,\n" + + " 0 实际交货数量,\n" + + " 0 退货数量 \n" + + " FROM\n" + + " (\n" + + " SELECT\n" + + " '' AS 交货单号,\n" + + " NULL AS 交货日期,\n" + + " c.MaterialCode AS SAP编码,\n" + + " a.MaterialCode AS 物料代码,\n" + + " c.MaterialDesc AS 物料描述,\n" + + " c.EstimateTypeDesc AS 物料组,\n" + + " ISNULL( a.PurchasePriceNoTax, 0 ) AS 开票单价,\n" + + " ISNULL( a.ReceiptQty, 0 ) AS 收货数量,\n" + + " ISNULL( a.InvoicedQty, 0 ) AS 开票数量 ,\n" + + " ISNULL( a.ReceiptQty, 0 ) * ISNULL( a.PurchasePriceNoTax, 0 ) AS 开票金额 \n" + + " FROM\n" + + " (\n" + + " SELECT SUM\n" + + " ( ReceiptQty ) AS ReceiptQty,\n" + + " SUM ( InvoicedQty ) InvoicedQty,\n" + + " MaterialCode,\n" + + " PurchasePriceNoTax \n" + + " FROM\n" + + " Set_SparePart \n" + + " WHERE\n" + + " Extend != 'is90' \n" + + " AND Version = '{0}' \n" + + " AND PurchaseOrderNo IS NULL \n" + + " GROUP BY\n" + + " MaterialCode,\n" + + " PurchasePriceNoTax \n" + + " ) AS a\n" + + " LEFT JOIN ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, MaterialCode FROM Set_WMSSparePart GROUP BY MaterialCode ) AS b ON a.MaterialCode = b.MaterialCode\n" + + " LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" + + " ) AS temp1\n" + + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = ( SELECT MAX ( VERSION ) FROM Set_PriceList ) ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + + " ) union2"; + + + + string _sql = string.Format(sqlString, version); + + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); - //if (!string.IsNullOrEmpty(purchaseOrderNo)) - //{ - // addwhere += string.Format(" AND PurchaseOrderNo LIKE '{0}%' ", purchaseOrderNo); - //} - //else if (!string.IsNullOrEmpty(sapCode)) - //{ - // addwhere += string.Format(" AND SAPCode LIKE '{0}%' ", sapCode); - //} - //else if (!string.IsNullOrEmpty(matialCode)) - //{ - // addwhere += string.Format(" AND MaterialCode LIKE '{0}%' ", matialCode); - //} - //else if (!string.IsNullOrEmpty(begintime)&& !string.IsNullOrEmpty(endtime)) - //{ - // addwhere += string.Format(" AND OrderDate BETWEEN '{0}' AND '{1}' ", begintime, endtime); - //} + var _lst = _query.ToList(); - string _sql = string.Format(addSqlStr, addwhere); - //string _sql = string.Format(sqlString, version); - var _query = DbConnection.Query(_sql, null, null, true, 1200, null); - return _query.ToList(); + var sql1 = "SELECT\n" + + " A.WMSDeliveryNote WmsBillNum,\n" + + " t1.MaterialCode MaterialCode,\n" + + " A.PurchaseOrderNo,\n" + + " A.SpareDate WmsDate \n" + + "FROM\n" + + " Set_WMSSparePart A\n" + + " INNER JOIN ( SELECT MaterialCode, PurchaseOrderNo FROM Set_WMSSparePart GROUP BY MaterialCode, PurchaseOrderNo HAVING COUNT ( 1 ) = 1 ) B ON A.PurchaseOrderNo = B.PurchaseOrderNo \n" + + " AND A.MaterialCode = B.MaterialCode\n" + + " LEFT JOIN Set_material t1 ON A.MaterialCode = t1.CustomerPartCode \n" + + "WHERE\n" + + " A.WMSDeliveryNote IS NOT NULL "; + + + var listCompare1 = DbConnection.Query(sql1); + + + List _ls1 = new List(); + foreach (var itm in listCompare1.ToList()) + { + var first = _ls1.FirstOrDefault(p => p.Kanban == itm.Kanban && p.MaterialCode == itm.MaterialCode); + if (first != null) + { + if (!string.IsNullOrEmpty(itm.WmsDate)) + { + itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString(); + } + + first.WmsBillNum += "," + itm.WmsBillNum; + first.WmsDate += "," + itm.WmsDate; + } + else + { + if (!string.IsNullOrEmpty(itm.WmsDate)) + { + itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString(); + } + _ls1.Add(itm); + } + + } + + + + + var sql2 = "SELECT\n" + + " A.WMSDeliveryNote WmsBillNum,\n" + + " t1.MaterialCode MaterialCode,\n" + + " A.PurchaseOrderNo,\n" + + " A.SpareDate WmsDate \n" + + "FROM\n" + + " Set_WMSSparePart A\n" + + " INNER JOIN ( SELECT MaterialCode, PurchaseOrderNo FROM Set_WMSSparePart GROUP BY MaterialCode, PurchaseOrderNo HAVING COUNT ( * ) > 1 ) B ON A.PurchaseOrderNo = B.PurchaseOrderNo \n" + + " AND A.MaterialCode = B.MaterialCode\n" + + " LEFT JOIN Set_material t1 ON A.MaterialCode = t1.CustomerPartCode"; + + var listCompare = DbConnection.Query(sql2); + + + + List _ls = new List(); + foreach (var itm in listCompare.ToList()) + { + var first = _ls.FirstOrDefault(p => p.Kanban == itm.Kanban && p.MaterialCode == itm.MaterialCode); + if (first != null) + { + if (!string.IsNullOrEmpty(itm.WmsDate)) + { + itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString(); + } + + first.WmsBillNum += "," + itm.WmsBillNum; + first.WmsDate += "," + itm.WmsDate; + } + else + { + if (!string.IsNullOrEmpty(itm.WmsDate)) + { + itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString(); + } + _ls.Add(itm); + } + + } + + + foreach (var itm1 in _lst) + { + //itm1.收货与交货差异 = itm1.收货数量 - ((!string.IsNullOrEmpty(itm1.实际交货数量)) ? decimal.Parse(itm1.实际交货数量) : 0); + var item = _ls1.FirstOrDefault(p => p.Kanban == itm1.采购订单号 && p.MaterialCode == itm1.SAP编码); + if (item != null) + { + itm1.交货单号 = item.WmsBillNum; + itm1.交货日期 = item.WmsDate; + } + + + + var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.采购订单号 && p.MaterialCode == itm1.SAP编码); + if (itm != null) + { + itm1.交货单号 = itm.WmsBillNum; + itm1.交货日期 = itm.WmsDate; + } + + + } + + return _lst; } + + /// + /// 带采购订单号和无订单号一起统计报表 WHERE Extend != 'is90' + /// + /// + /// + /// + /// + /// + /// + /// + //public virtual List GetSettleSparePartReportList(string purchaseOrderNo, string version, string sapCode, string matialCode, + // string begintime, string endtime) + //{ + // string sqlString = "SELECT\n" + + // " union1.* \n" + + // "FROM\n" + + // " (\n" + + // " SELECT\n" + + // " temp1.交货日期,\n" + + // " temp1.交货单号,\n" + + // " '' 订单日期,\n" + + // " temp1.采购订单号,\n" + + // " temp1.SAP编码,\n" + + // " temp1.物料代码,\n" + + // " temp1.物料描述,\n" + + // " temp1.采购订单文本,\n" + + // " temp1.发货数量,\n" + + // " temp1.开票数量,\n" + + // " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 发货与开票差异,\n" + + // " temp1.开票单价,\n" + + // " ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" + + // " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + + // " temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + + // " ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额 \n" + + // " FROM\n" + + // " (\n" + + // " SELECT\n" + + // " a.Version AS 期间,\n" + + // " a.PurchaseOrderNoText AS 采购订单文本,\n" + + // " b.WMSDeliveryNote AS 交货单号,\n" + + // " b.SpareDate AS 交货日期,\n" + + // " a.PurchaseOrderNo AS 采购订单号,\n" + + // " c.MaterialCode AS SAP编码,\n" + + // " b.MaterialCode AS 物料代码,\n" + + // " c.MaterialDesc AS 物料描述,\n" + + // " c.EstimateTypeDesc AS 物料组,\n" + + // " a.PurchasePriceNoTax AS 开票单价,\n" + + // " 0 AS 数量差异,\n" + + // " ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" + + // " ISNULL( a.InvoicedQty, 0 ) AS 开票数量 ,\n" + + // " ISNULL( a.AmountNoTax, 0 ) AS 开票金额 \n" + + // " FROM\n" + + // " (\n" + + // " SELECT SUM\n" + + // " ( ReceiptQty ) AS ReceiptQty,\n" + + // " PurchaseOrderNo,\n" + + // " MaterialCode,\n" + + // " Version,\n" + + // " PurchasePriceNoTax,\n" + + // " InvoicedQty,\n" + + // " PurchaseOrderNoText,\n" + + // " AmountNoTax \n" + + // " FROM\n" + + // " Set_SparePart WHERE Extend != 'is90' \n" + + // " GROUP BY\n" + + // " PurchaseOrderNo,\n" + + // " MaterialCode,\n" + + // " Version,\n" + + // " PurchasePriceNoTax,\n" + + // " InvoicedQty,\n" + + // " PurchaseOrderNoText,\n" + + // " AmountNoTax \n" + + // " ) AS a\n" + + // " INNER JOIN (\n" + + // " SELECT SUM\n" + + // " ( ReceiptQty ) AS ReceiptQty,\n" + + // " PurchaseOrderNo,\n" + + // " SapCode,\n" + + // " MaterialCode,\n" + + // " WMSDeliveryNote,\n" + + // " SpareDate \n" + + // " FROM\n" + + // " Set_WMSSparePart \n" + + // " GROUP BY\n" + + // " PurchaseOrderNo,\n" + + // " SapCode,\n" + + // " MaterialCode,\n" + + // " WMSDeliveryNote,\n" + + // " SpareDate \n" + + // " ) AS b ON a.PurchaseOrderNo = b.PurchaseOrderNo \n" + + // " AND a.MaterialCode = b.MaterialCode\n" + + // " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + + // " WHERE\n" + + // " ( a.Version = '{0}' ) \n" + + // " ) AS temp1\n" + + // " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + + // " ) union1 UNION ALL\n" + + // "SELECT\n" + + // " union2.* \n" + + // "FROM\n" + + // " (\n" + + // " SELECT\n" + + // " temp1.交货日期,\n" + + // " '' 交货单号,\n" + + // " '' 订单日期,\n" + + // " '' 采购订单号,\n" + + // " temp1.SAP编码,\n" + + // " temp1.物料代码,\n" + + // " temp1.物料描述,\n" + + // " temp1.采购订单文本,\n" + + // " temp1.发货数量,\n" + + // " temp1.开票数量,\n" + + // " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) AS 发货与开票差异,\n" + + // " temp1.开票单价,\n" + + // " ISNULL( temp1.开票金额, 0 ) AS 开票金额,\n" + + // " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + + // " temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + + // " ( temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.开票数量 AS 差异总金额 \n" + + // " FROM\n" + + // " (\n" + + // " SELECT\n" + + // " a.Version AS 期间,\n" + + // " '' AS 采购订单文本,\n" + + // " NULL AS 交货日期,\n" + + // " c.MaterialCode AS SAP编码,\n" + + // " a.MaterialCode AS 物料代码,\n" + + // " c.MaterialDesc AS 物料描述,\n" + + // " c.EstimateTypeDesc AS 物料组,\n" + + // " a.PurchasePriceNoTax AS 开票单价,\n" + + // " 0 AS 数量差异,\n" + + // " ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" + + // " ISNULL( a.ReceiptQty, 0 ) AS 开票数量 ,\n" + + // " ISNULL( a.ReceiptQty, 0 ) * ISNULL( a.PurchasePriceNoTax, 0 ) AS 开票金额 \n" + + // " FROM\n" + + // " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, MaterialCode, Version, PurchasePriceNoTax FROM Set_SparePart WHERE Extend != 'is90' and PurchaseOrderNo is null GROUP BY MaterialCode, Version, PurchasePriceNoTax ) AS a\n" + + // " LEFT JOIN ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, SapCode, MaterialCode FROM Set_WMSSparePart GROUP BY SapCode, MaterialCode ) AS b ON a.MaterialCode = b.MaterialCode\n" + + // " LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" + + // " WHERE\n" + + // " ( a.Version = '{0}' ) \n" + + // " ) AS temp1\n" + + // " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + + // " ) union2"; + + // //" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp.Sap编码 = TEMP2.MaterialCode\n" + + // string addwhere = string.Empty; + // string addSqlStr = string.Format(sqlString, version); + + // //if (!string.IsNullOrEmpty(purchaseOrderNo)) + // //{ + // // addwhere += string.Format(" AND PurchaseOrderNo LIKE '{0}%' ", purchaseOrderNo); + // //} + // //else if (!string.IsNullOrEmpty(sapCode)) + // //{ + // // addwhere += string.Format(" AND SAPCode LIKE '{0}%' ", sapCode); + // //} + // //else if (!string.IsNullOrEmpty(matialCode)) + // //{ + // // addwhere += string.Format(" AND MaterialCode LIKE '{0}%' ", matialCode); + // //} + // //else if (!string.IsNullOrEmpty(begintime)&& !string.IsNullOrEmpty(endtime)) + // //{ + // // addwhere += string.Format(" AND OrderDate BETWEEN '{0}' AND '{1}' ", begintime, endtime); + // //} + + // string _sql = string.Format(addSqlStr, addwhere); + // //string _sql = string.Format(sqlString, version); + // var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + // return _query.ToList(); + + //} + /// /// 有结算无发货的报表统计 /// @@ -239,8 +498,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ISNULL( a.ReceiptQty, 0 ) AS 开票数量 ,\n" + " ISNULL( a.ReceiptQty, 0 ) * ISNULL( a.PurchasePriceNoTax, 0 ) AS 开票金额 \n" + " FROM\n" + - " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, MaterialCode, Version, PurchasePriceNoTax FROM Set_SparePart WHERE Extend != 'is90' GROUP BY MaterialCode, Version, PurchasePriceNoTax ) AS a\n" + - " LEFT JOIN ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, SapCode, MaterialCode FROM Set_WMSSparePart GROUP BY SapCode, MaterialCode ) AS b ON a.MaterialCode = b.MaterialCode\n" + + " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, MaterialCode, PurchasePriceNoTax FROM Set_SparePart WHERE Extend != 'is90' GROUP BY MaterialCode, PurchasePriceNoTax ) AS a\n" + + " LEFT JOIN ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, MaterialCode FROM Set_WMSSparePart GROUP BY MaterialCode ) AS b ON a.MaterialCode = b.MaterialCode\n" + " LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" + " WHERE\n" + " ( a.Version = '{0}' ) \n" + @@ -304,7 +563,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ISNULL( b.ReceiptQty, 0 ) AS 开票数量 ,\n" + " ISNULL( b.ReceiptQty, 0 ) * ISNULL( b.PurchasePriceNoTax, 0 ) AS 开票金额 \n" + " FROM\n" + - " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, SapCode, MaterialCode FROM Set_WMSSparePart GROUP BY SapCode, MaterialCode ) AS a\n" + + " ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, MaterialCode FROM Set_WMSSparePart GROUP BY MaterialCode ) AS a\n" + " LEFT JOIN ( SELECT * FROM Set_SparePart WHERE Extend != 'is90' AND Version = '{0}' ) AS b ON a.MaterialCode = b.MaterialCode\n" + " LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" + " WHERE\n" + @@ -395,10 +654,11 @@ public class SparePartSumQtyDiff [ExporterHeader(DisplayName = "采购订单文本")] public string 采购订单文本 { set; get; } - [ExporterHeader(DisplayName = "发货数量")] - public decimal 发货数量 { set; get; } + [ExporterHeader(DisplayName = "收货数量")] + public decimal 收货数量 { set; get; } [ExporterHeader(DisplayName = "开票数量")] public decimal 开票数量 { set; get; } + [ExporterHeader(DisplayName = "发货与开票差异")] public decimal 发货与开票差异 { set; get; } [ExporterHeader(DisplayName = "开票单价")] @@ -417,5 +677,16 @@ public class SparePartSumQtyDiff [ExporterHeader(DisplayName = "寄售库存数量")] public decimal 寄售库存数量 { set; get; } + [ExporterHeader(DisplayName = "交货数量")] + public decimal 交货数量 { set; get; } + + [ExporterHeader(DisplayName = "退货数量")] + public string 退货数量 { set; get; } + + [ExporterHeader(DisplayName = "实际交货数量")] + public string 实际交货数量 { set; get; } + [ExporterHeader(DisplayName = "收货与交货差异")] + public decimal 收货与交货差异 { set; get; } + } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs index 9cfbc6bf..75efd346 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs @@ -97,7 +97,7 @@ namespace SettleAccount.Job.Services.Report ExcelExporter _exporter = new ExcelExporter();//导出Excel - var result = _exporter.Append(_ls.ToList(), "大众备件数据调整") + var result = _exporter.Append(_ls.ToList(), "大众备件数据调整输出") .SeparateBySheet() .Append(_unls.ToList(), "有发货无结算") .ExportAppendDataAsByteArray();