From d4562e2f23f7ab2e24273e8a98933dfe880cf196 Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 23 Feb 2022 15:01:18 +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 --- .../HQHSettledDetailDapperRepository.cs | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) 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 00a24751..ceba82e8 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 @@ -11,6 +11,15 @@ using Volo.Abp.EntityFrameworkCore; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { + public class CompareExtend + { + public string WmsBillNum { set; get; } + public string MaterialCode { set; get; } + public string Kanban { set; get; } + + } + + /// /// 红旗H平台输出报表 /// @@ -99,7 +108,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "FROM\n" + " (\n" + " SELECT\n" + - " b.WmsBillNum AS 交货单号,\n" + + " '' AS 交货单号,\n" + " CONVERT ( VARCHAR ( 100 ), b.LastModificationTime, 23 ) AS 交货时间,\n" + " b.IsAuto AS 手工或自动,\n" + " a.StorageLocation AS 收货仓库,\n" + @@ -124,12 +133,40 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AND a.MaterialCode = b.MaterialCode\n" + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " WHERE\n" + - - " a.Version= '{0}' {1} \n" + + + " a.Version= '{0}' {1} \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 WHERE temp1.[交货单号] is not null "; var _sql = string.Format(str, version, condition); + + + var sql2 = "SELECT\n" + + " a.WmsBillNum,\n" + + " a.MaterialCode,\n" + + " a.Kanban \n" + + "FROM\n" + + " Set_HQ_H_Kanban A\n" + + " INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_HQ_H_Kanban GROUP BY MaterialCode, Kanban HAVING COUNT(*)> 1 ) B ON A.Kanban = B.Kanban \n" + + " AND A.MaterialCode = B.MaterialCode"; + + + 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) + { + first.WmsBillNum += itm.WmsBillNum; + } + + + } + + + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); _list = _query.ToList(); return _list;