From 03ebdb5856e0bf2e6be2cc041cb2f88770f161b7 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Tue, 31 May 2022 20:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E4=BC=97=E5=A4=87=E4=BB=B6=E6=97=A0?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E5=8A=A0=E4=B8=8A=20=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=95=B0=E9=87=8F=20=E4=B8=80=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSSharePartAppService.cs | 28 ++++++++++--------- .../Entities/WMS/TaskList.cs | 10 ++++++- .../HQHSettledDetailDapperRepository.cs | 4 +-- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index c211e030..1e59fa3b 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -200,7 +200,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts tm1 == null ? 0 : tm1.Qty, itm.OutPutQty, itm.Price, - itm.Amt + itm.Amt, + itm.RealityNumber ); @@ -246,7 +247,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); List _lst = new List();//无订单 - List _lstBill = new List();//有订单 + List _lst90Bill = new List();//有订单 foreach (var filename in fileList) { string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; @@ -258,7 +259,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts //NoOrder用来标识采购订单号为空的数据 var _list = _listSummary.Where(p => p.OrderBillNum == "NoOrder").ToList();//没有采购订单号的集合 - var _listBill = _list90Summary.Where(p => !string.IsNullOrEmpty(p.OrderBillNum) && p.OrderBillNum != "NoOrder").ToList();//有采购订单号的集合 + var _list90Bill = _list90Summary.Where(p => !string.IsNullOrEmpty(p.OrderBillNum) && p.OrderBillNum != "NoOrder").ToList();//有采购订单号的集合 //var _list = _excelHelper.ExcelToList(); @@ -288,15 +289,16 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts p.StockQty, p.Qty, p.Price, - p.Amt + p.Amt, + p.RealityNumber )); _lst.AddRange(_list.ToArray()); } - if (_listBill != null && _listBill.Count() > 0) + if (_list90Bill != null && _list90Bill.Count() > 0) { - var _lsAry = _listBill.Select(p => new - WmsSharePartOutPutDetial( + var _lsAry = _list90Bill.Select(p => new + WmsSharePart90OutPutDetial( GuidGenerator.Create(), p.WmsBillNum, p.OrderBillNum, @@ -320,7 +322,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts p.Price, p.Amt )); - _lstBill.AddRange(_listBill.ToArray()); + _lst90Bill.AddRange(_list90Bill.ToArray()); } } @@ -371,7 +373,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts p.StockQty, p.Qty, p.Price, - p.Amt + p.Amt,p.RealityNumber )).ToList(); await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNoNum); @@ -409,13 +411,13 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts //有采购订单号 //往Set_WmsSharePart90OutPutDetial表中存储 - if (_lstBill != null && _lstBill.Count>0) + if (_lst90Bill != null && _lst90Bill.Count>0) { //有采购订单号 var outPutDetailBill = await _wmsRepository90.Where(p => p.Version == input.Version && !string.IsNullOrEmpty(p.OrderBillNum)).ToListAsync(); var error = from itm1 in outPutDetailBill - join itm2 in _lstBill on + join itm2 in _lst90Bill on new { itm1.MaterialCode, itm1.OrderBillNum } equals new { itm2.MaterialCode, itm2.OrderBillNum } @@ -424,7 +426,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); if (errList.Count() == 0) { - var queryBill = from itm1 in _lstBill + var queryBill = from itm1 in _lst90Bill join itm2 in outPutDetailBill on new { itm1.MaterialCode, itm1.OrderBillNum } equals @@ -714,7 +716,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts , 0 , itm.Qty , itm.Price - , itm.Amt + , itm.Amt,itm.RealityNumber ); _lsCopy.Add(_detail); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs index 7baa0645..a36225c0 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs @@ -2160,7 +2160,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public WmsSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty, - decimal outputQty, decimal price, decimal amt) + decimal outputQty, decimal price, decimal amt,decimal realqty) { Id = id; WmsBillNum = wmsBillNum; @@ -2183,6 +2183,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS OutPutQty = outputQty; Price = price; Amt = amt; + RealityNumber = realqty; } @@ -2267,6 +2268,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [ImporterHeader(Name = "出库数量", IsIgnore = true)] [ExporterHeader(DisplayName = "出库数量", IsIgnore = true)] public decimal OutPutQty { set; get; } + + + [ImporterHeader(Name = "真实数量", IsIgnore = true)] + [ExporterHeader(DisplayName = "真实数量", IsIgnore = true)] + public decimal RealityNumber { set; get; } + + [ImporterHeader(Name = "开票单价")] [ExporterHeader(DisplayName = "开票单价")] 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 5ba81c16..a45f719e 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 @@ -280,7 +280,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //var listCompare = DbConnection.Query(sql2); - var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); + //var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); @@ -299,7 +299,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //"WHERE\n" + //" B.Kanban IS NULL"; - var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); + // var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);