From c642cba072af590834fcbef5855f11647317163b Mon Sep 17 00:00:00 2001 From: Administrator Date: Mon, 7 Mar 2022 16:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/UnSettle/UnSettleDetailReport.cs | 6 ++ .../Report/ErpSumOutputDapperRepository.cs | 4 +- .../HQHSettledDetailDapperRepository.cs | 10 +- .../Report/KanbanUnSettledDapperRepository.cs | 9 +- .../Report/UnSettledDetailDapperRepository.cs | 26 ++++- .../Report/WmsOutputSumDapperRepository.cs | 95 ++++++++++++++++--- 6 files changed, 127 insertions(+), 23 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs index 3ece8c63..6fdcfb0c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs @@ -50,8 +50,13 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle public decimal UnSettleQty { set; get; } [ExporterHeader(DisplayName = "差异金额")] public decimal DiffAMT { set; get; } + + [ExporterHeader(DisplayName = "退货数量")] + public decimal ReturnQty { set; get; } + [ExporterHeader(DisplayName = "差异数量")] public decimal DiffQty { set; get; } + [ExporterHeader(DisplayName = "漏结标识 ")] public string Flag { set; get; } [ExporterHeader(DisplayName = "漏结期间 ")] @@ -59,5 +64,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle [ExporterHeader(DisplayName = "说明 ")] public string Remark { set; get; } + } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs index a78139f7..1de5c519 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs @@ -226,7 +226,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report taskid, itm.行号, itm.结算单, - "ZOR1", + "ZKE1", "1001", "00", itm.销售渠道, @@ -235,7 +235,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report itm.结算编码, itm.物料号, "1000", - itm.寄售类别, + string.Empty, itm.已出库金额, itm.实际出库数量, 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 a99802df..fe54d01a 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 @@ -852,9 +852,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.结算金额,\n" + " isnull( TEMP2.Price, 0 ) AS 发货定价,\n" + " isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" + - " 0 AS 数量差异,\n" + - " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" + - " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.发货数量 AS 差异总金额 \n" + + " isnull( tt.Qty, 0 ) 退货数量,\n" + + "isnull( temp1.发货数量, 0 )-isnull( tt.Qty, 0 ) AS 数量差异,\n" + + "temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" + + "(temp1.结算单价 - ISNULL( TEMP2.Price, 0 )) * (isnull( temp1.发货数量, 0 )-isnull( tt.Qty, 0 )) AS 差异总金额 \n" + "FROM\n" + " (\n" + " SELECT\n" + @@ -884,7 +885,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " b.HQHKanBan IS NULL \n" + " AND b.MaterialCode IS NULL {0}\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"; + " 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" + + " left join set_backQty tt on temp1.Sap编码 = tt.MaterialCode and temp1.订货看板编号 = tt.Code "; var _sql = string.Format(str, condition); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs index 8786dcb6..ea0344aa 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs @@ -79,8 +79,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public decimal SettleQty { set; get; } [ExporterHeader(DisplayName = "发货数量")] public decimal WMSDeliveryQty { set; get; } + [ExporterHeader(DisplayName = "退货数量")] + public decimal BackQty { set; get; } [ExporterHeader(DisplayName = "量差")] public decimal DiffQty { set; get; } + + [ExporterHeader(DisplayName = "单价")] public decimal Price { set; get; } [ExporterHeader(DisplayName = "差异金额")] @@ -153,12 +157,15 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " C.EstimateTypeDesc MaterialGroup,\n" + " ISNULL( B.Qty, 0 ) SettleQty,\n" + " ISNULL( a.WMSDeliveryQty, 0 ) WMSDeliveryQty,\n" + - " ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 ) ) AS DiffQty \n" + + " isnull(tt.qty, 0) BackQty, \n"+ + " ( ISNULL( a.WMSDeliveryQty, 0 ) - ISNULL( b.Qty, 0 )-isnull(tt.qty, 0) ) AS DiffQty \n" + " FROM\n" + " Set_WMSKanBanSettle A\n" + " LEFT JOIN ( SELECT * FROM Set_KanBanSettle ) B ON A.Kanban = B.Kanban \n" + " AND A.MaterialCode = B.MaterialCode\n" + " LEFT JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode \n" + + + " left join set_backQty as tt on a.Kanban = tt.Code and a.MaterialCode = b.MaterialCode \n"+ " WHERE\n" + " B.Kanban IS NULL \n" + " AND B.MaterialCode IS NULL {0}\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs index ab703b23..8cfd0c1c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs @@ -58,7 +58,27 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //} var sqlString = " SELECT\n" + -" temp1.*,\n" + + + +" temp1.WMSState,\n" + +" temp1.WMSBillNum ,\n" + +" temp1.UnSettleVersion ,\n" + +" temp1.CP5Time ,\n" + +" temp1.MaterialCode ,\n" + +" temp1.ChassisNumber ,\n" + +" temp1.KENNCode ,\n" + +" temp1.chassisNumber2 ,\n" + +" temp1.KENNCode2 ,\n" + +" temp1.QTY ,\n" + +" temp1.ParentSapMaterialCode ,\n" + +" temp1.FLAG ,\n" + +" temp1.UnSettleQty ,\n" + +" temp1.MaterialGroup ,\n" + +" temp1.MaterialDesc ,\n" + +" temp1.ParentMaterialDesc ,\n" + +" temp1.SapMaterialCode ,\n" + +" temp1.DiffQty-isnull(tt.Qty ,0) DiffQty,\n" + +" isnull(tt.Qty ,0) ReturnQty,\n" + " temp2.Price,\n" + " ISNULL( temp1.QTY, 0 )* ISNULL( temp2.Price, 0 ) AMT, \n" + " Round(ISNULL( temp1.DiffQty, 0 )* ISNULL( temp2.Price, 0 ),2) DiffAMT \n" + @@ -120,8 +140,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " LEFT JOIN Set_material B ON a.MaterialCode = b.CustomerPartCode \n" + " LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) d ON a.ParentSapMaterialCode = d.MaterialCode \n" + " ) temp1\n" + -" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode"; - +" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode \n"+ + " left join set_backQty tt on temp1.SapMaterialCode = tt.MaterialCode and temp1.ChassisNumber = tt.Code "; //var _materialList = DbConnection.Query("select * from set_material").ToList(); //var _priceList = DbConnection.Query("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs index 5e3f098b..7ee7c66c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs @@ -12,6 +12,75 @@ using Volo.Abp.EntityFrameworkCore; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { + + public class WmsOutputSumReport2 + { + [ImporterHeader(Name = "行号")] + [ExporterHeader(DisplayName = "行号")] + public string 行号 { set; get; } + [ImporterHeader(Name = "客户")] + [ExporterHeader(DisplayName = "客户")] + public string 客户 { set; get; } + [ImporterHeader(Name = "出库类型")] + [ExporterHeader(DisplayName = "出库类型")] + public string 出库类型 { set; get; } + //[ImporterHeader(Name = "结算编码")] + //[ExporterHeader(DisplayName = "结算编码")] + //public string 结算编码 { set; get; } + //[ImporterHeader(Name = "销售渠道")] + //[ExporterHeader(DisplayName = "销售渠道")] + //public string 销售渠道 { set; get; } + //[ImporterHeader(Name = "客户代码")] + //[ExporterHeader(DisplayName = "客户代码")] + public string 客户代码 { set; get; } + [ImporterHeader(Name = "结算单")] + [ExporterHeader(DisplayName = "结算单")] + public string 结算单 { set; get; } + [ImporterHeader(Name = "物料号")] + [ExporterHeader(DisplayName = "物料号")] + public string 物料号 { set; get; } + [ImporterHeader(Name = "条码号")] + [ExporterHeader(DisplayName = "条码号")] + public string 通用代码号 { set; get; } + //[ImporterHeader(Name = "寄售类别")] + //[ExporterHeader(DisplayName = "寄售类别")] + //public string 寄售类别 { set; get; } + [ImporterHeader(Name = "结算数量")] + [ExporterHeader(DisplayName = "结算数量")] + public decimal 结算数量 { set; get; } + [ImporterHeader(Name = "实际出库数量")] + [ExporterHeader(DisplayName = "实际出库数量")] + public decimal 实际出库数量 { set; get; } + [ImporterHeader(Name = "差异数量")] + [ExporterHeader(DisplayName = "差异数量")] + public decimal 差异数量 { set; get; } + [ImporterHeader(Name = "开票单价")] + [ExporterHeader(DisplayName = "开票单价")] + public decimal 开票单价 { set; get; } + [ImporterHeader(Name = "结算金额")] + [ExporterHeader(DisplayName = "结算金额")] + public decimal 结算金额 { set; get; } + [ImporterHeader(Name = "已出库金额")] + [ExporterHeader(DisplayName = "已出库金额")] + public decimal 已出库金额 { set; get; } + [ImporterHeader(Name = "WMS待出库金额")] + [ExporterHeader(DisplayName = "WMS待出库金额")] + public decimal WMS待出库金额 { set; get; } + [ImporterHeader(Name = "物料组编码")] + [ExporterHeader(DisplayName = "物料组编码")] + public string 物料组编码 { set; get; } + [ImporterHeader(Name = "物料组车型")] + [ExporterHeader(DisplayName = "物料组车型")] + public string 物料组车型 { set; get; } + [ImporterHeader(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string 物料描述 { set; get; } + [ImporterHeader(Name = "备注")] + [ExporterHeader(DisplayName = "备注")] + public string 备注 { set; get; } + } + + public class WmsOutputSumReport { [ImporterHeader(Name = "行号")] @@ -38,12 +107,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ImporterHeader(Name = "物料号")] [ExporterHeader(DisplayName = "物料号")] public string 物料号 { set; get; } - [ImporterHeader(Name = "通用代码号")] - [ExporterHeader(DisplayName = "通用代码号")] + [ImporterHeader(Name = "条码号")] + [ExporterHeader(DisplayName = "条码号")] public string 通用代码号 { set; get; } - [ImporterHeader(Name = "寄售类别")] - [ExporterHeader(DisplayName = "寄售类别")] - public string 寄售类别 { set; get; } + //[ImporterHeader(Name = "寄售类别")] + //[ExporterHeader(DisplayName = "寄售类别")] + //public string 寄售类别 { set; get; } [ImporterHeader(Name = "结算数量")] [ExporterHeader(DisplayName = "结算数量")] public decimal 结算数量 { set; get; } @@ -636,11 +705,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report - - public virtual List GetWmsSumReportList(string version,string state) + + public virtual List GetWmsSumReportList(string version, string state) { @@ -658,10 +727,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.Price 开票单价,\n" + " Round( Isnull( temp1.Qty, 0 )* temp1.Price, 2 ) 结算金额,\n" + " Round(( Isnull( temp1.Qty, 0 )- Isnull( temp1.OutputQty, 0 ))* temp1.Price, 2 ) WMS待出库金额, \n" + - " temp2.EstimateType 物料组编码, \n" + - " temp2.EstimateTypeDesc 物料组车型, \n" + - " temp2.MaterialDesc 物料描述, \n" + - " temp1.remark 备注 \n" + + " temp2.EstimateType 物料组编码, \n" + + " temp2.EstimateTypeDesc 物料组车型, \n" + + " temp2.MaterialDesc 物料描述, \n" + + " temp1.remark 备注 \n" + "FROM\n" + " (\n" + " SELECT\n" + @@ -798,9 +867,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " LEFT JOIN(SELECT max(Id) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType) temp2 ON temp1.MaterialCode = temp2.MaterialCode "; - _sql = string.Format(_sql, version,state); + _sql = string.Format(_sql, version, state); - var _query = DbConnection.Query(_sql,null,null,true,1200,null); + var _query = DbConnection.Query(_sql, null, null, true, 1200, null);