From ded15fbd17b60f0ac18f6f8223f25e323a9d1d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 23 Sep 2023 10:02:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E5=BA=9F=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E4=B8=9A=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/BBAC_BA_SERVICE.cs | 9 +++------ .../Entities/BQ/HBPO_BA_SERVICE.cs | 8 ++++---- .../Entities/BQ/PUB_BA_SERVICE.cs | 8 ++++---- .../Entities/BQ/Managers/INV_MNG.cs | 2 +- .../Entities/BQ/Managers/INV_MNG_EXT.cs | 12 ++++++------ 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 92ebdfc5..619f8a0f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -89,9 +89,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum).ConfigureAwait(false); var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); - - - if (settle == null) { throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不在请检查!", "400"); @@ -269,7 +266,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ isReturn: itm.Qty > 0 ? false : true, settleDate: itm.SettleDate, groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, + invGroupNum: inv.InvGroupNum, contactid: itm.Extend1,//生产号 invbillnum: string.Empty, partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode @@ -388,7 +385,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); var errorList=await CheckAdJRules(adjlist, relist.ToList(),inv.BusinessType); @@ -526,7 +523,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); var errorList = await CheckAdJRules(adjlist, relist.ToList(), inv.BusinessType); if (errorList.Count > 0) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index dc0fb2f5..42191652 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -212,7 +212,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ // var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); var errors = await CheckAdJRules(adjlist, relist.ToList(), inv.BusinessType); if (errors.Count > 0) @@ -235,7 +235,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: itm.BusinessType, settleDate: itm.SettleDate, groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, + invGroupNum: inv.InvGroupNum, invbillnum: string.Empty, partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode )); @@ -344,7 +344,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); foreach (var itm in adjlist) { @@ -491,7 +491,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index 2ffbe5c2..44587afe 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -99,7 +99,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); @@ -125,7 +125,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: itm.BusinessType, settleDate: itm.SettleDate, groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, + invGroupNum: inv.InvGroupNum, invbillnum: string.Empty, partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode, pobillnum: string.Empty @@ -372,7 +372,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); var errorList = await CheckAdJRules(adjlist, relist.ToList(), inv.BusinessType); if (errorList.Count > 0) @@ -543,7 +543,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { - var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); + var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index 8c0f8273..d7359337 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -945,7 +945,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// 版本号 /// 发票分组 /// 原发票号 - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public async Task> SecInvoice(List p_list, List p_ajdlist, List dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs index 9cbf3989..698123b6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs @@ -467,7 +467,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var groupList = new List(); var notDetialList = new List(); var invlist = new List(); - var salist = new List(); + // var salist = new List(); var adjlist = new List(); foreach (var group in invoiceMap) { @@ -479,11 +479,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers on new { LU = itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } join itm2 in details on new { itm.LU, itm.PartCode, itm.PN, itm.SettleDate } equals new { itm2.LU, itm2.PartCode, itm2.PN, itm2.SettleDate } select itm2; - foreach (var itm in query) - { - itm.InvbillNum = key; - salist.Add(itm); - } + //foreach (var itm in query) + //{ + // itm.InvbillNum = key; + // salist.Add(itm); + //} if (!string.IsNullOrEmpty(p_parentInvBillNum))//发票作废开票 { var query1 = from itm in dtos