From 4ab2def3da5980c3c5143f680c22f45daf3a6836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 21 Sep 2023 17:23:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A1=AB=E5=8A=A0[UnitOfWork(false)]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/BA_SERVICE.cs | 6 ++--- .../Bases/CAN_SA_SERVICE.cs | 4 +-- .../Bases/PD_SERVICE.cs | 6 ++--- .../Entities/BQ/BBAC_BA_SERVICE.cs | 6 ++--- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 3 ++- .../Entities/BQ/HBPO_BA_SERVICE.cs | 6 ++--- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 2 +- .../Entities/BQ/INVOICE_SERVICE.cs | 2 +- .../Entities/BQ/PUB_BA_SERVICE.cs | 8 +++--- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 2 +- .../BQ/Syncs/PendingDeductionService.cs | 2 +- .../Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs | 2 -- .../Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs | 9 ++++++- .../Entities/BQ/Managers/INV_MNG.cs | 25 ++++++++----------- 14 files changed, 42 insertions(+), 41 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 0a35d164..0611e8af 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -524,7 +524,7 @@ namespace Win.Sfs.SettleAccount.Bases throw new BusinessException("8989", "生成失败,请检查调发票整表和旧发票内容"); } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 第一次开票 /// @@ -544,7 +544,7 @@ namespace Win.Sfs.SettleAccount.Bases } throw new BusinessException("8989", "生成失败,请检查调整表和旧发票内容"); } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// hbpo、jit、备件等 /// @@ -563,7 +563,7 @@ namespace Win.Sfs.SettleAccount.Bases throw new BusinessException("8989", "生成失败,请检查调发票整表和旧发票内容"); } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 第一次开票 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index c1f363e9..6143dcf2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -142,7 +142,7 @@ namespace Win.Sfs.SettleAccount.Bases var dtos = ObjectMapper.Map, List>(entitys); return new PagedResultDto(totalCount, dtos); } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// hbpo、jit、备件等 /// @@ -190,7 +190,7 @@ namespace Win.Sfs.SettleAccount.Bases throw new BusinessException("8989", "生成失败,请检可结算单明细数据是否结算分组存在"); } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 第一次开票 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index 8c0c0121..0e7ea5c9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using AutoMapper; using DocumentFormat.OpenXml.Bibliography; using DocumentFormat.OpenXml.Drawing.Charts; using DocumentFormat.OpenXml.Office2010.Excel; @@ -133,13 +133,13 @@ namespace Win.Sfs.SettleAccount.Bases return _fileName; } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public virtual async Task ApprovalPassed(List p_list) { return await InvokePD(p_list, _service, false); } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public virtual async Task RejectAsync(List p_list) { return await InvokePD(p_list, _service, true); 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 a1c4c035..92ebdfc5 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 @@ -203,7 +203,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 发票重开 /// @@ -338,7 +338,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 发票重开列表 /// @@ -482,7 +482,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 发票重开列表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index 44a57c74..00061dfa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -68,7 +68,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - [UnitOfWork(IsDisabled = false)] + + [UnitOfWork(false)] [HttpPost] public async Task GenerateInvoice([FromBody] string invbillNum) 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 f4411e89..f8ffc4d9 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 @@ -164,7 +164,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 发票重开 @@ -303,7 +303,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// 发票重开列表 /// /// @@ -442,7 +442,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// 发票重开列表 /// /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs index ced291f2..fc4adc53 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs @@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] //[Route("generateinvoice")] public async Task GenerateInvoice([FromBody] string invbillnum) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index 7342e7d4..9a363ef7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -83,7 +83,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public virtual async Task ApprovalPassed(List p_invs) { List errors = new List(); 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 62355113..9ad7f011 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 @@ -57,7 +57,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public virtual async Task ReissueInvoiceExtend(List p_list) { var errorlist = await CheckRepeat(p_list).ConfigureAwait(false); @@ -209,7 +209,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public override async Task ReissueInvoice([FromBody] string p_invbillnum) { //var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组 @@ -324,7 +324,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ return new JsonResult(new { Code = 200, Message = "发票重开成功" }); ; } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// 发票重开列表 /// /// @@ -509,7 +509,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public virtual async Task ReissueInvoiceList(List p_list) { var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index 8ceee7e3..47c00c1f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs @@ -63,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _notRepository = notRepository; } [HttpPost] - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public async Task GenerateInvoice([FromBody] string billnum) { var main = await _pubMng.GetMainAsync(billnum).ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index 3de22880..2b7731ce 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -31,7 +31,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs _dbcontext = dbcontext; } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public string ExportFile(Guid id, List exportName, List property) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs index 8ca22b50..1c1ef48e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs @@ -109,9 +109,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers break; } await _repository.DbContext.BulkUpdateAsync(new List { first }).ConfigureAwait(false); - return true; - } /// /// 向后流程 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs index 8ebbdc14..5e5e5886 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs @@ -7,6 +7,7 @@ using SettleAccount.Domain.BQ; using Volo.Abp.Domain.Services; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases.DomainServices; +using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers @@ -23,6 +24,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; private readonly INormalEfCoreRepository _notRepository; + private readonly INormalEfCoreRepository _priceRepository; private readonly BaseDomainService _service; public BBAC_NOT_SA_MNG() { @@ -32,9 +34,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers BaseDomainService service, INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository, - INormalEfCoreRepository notRepository + INormalEfCoreRepository notRepository, + INormalEfCoreRepository priceRepository ) { + _priceRepository = priceRepository; _repository = repository; _detailRepository = detailRepository; _notRepository = notRepository; @@ -42,6 +46,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } public virtual async Task> GenerateSettlementOrder(List p_list) { + var first = p_list.FirstOrDefault(); List errors = new List(); var priceErrors = await _service.CheckPriceList(p_list, first.Site).ConfigureAwait(false); @@ -52,6 +57,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers errors.Add($"生产号{itm.PN}零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据"); } } + + if (errors.Count > 0) { return errors; 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 09124f65..b82c4e64 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 @@ -1136,8 +1136,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers break; } - - var invbill = new INVOICE_GRP + var invbill = new INVOICE_GRP (guid: GuidGenerator.Create(), realnvBillNum: string.Empty, invbillNum: key, @@ -1154,12 +1153,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers taxDiff: 0, clientCode: string.Empty, realAmt: readAmt - ); invbill.ClientCode = clientCode; - - - invbill.Site = dtos.FirstOrDefault().Site; invlist.Add(invbill); } @@ -1180,7 +1175,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return _invls; } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] public async Task> FirstInvoice(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE { @@ -1647,7 +1642,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } //invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV"); } - List _entityDetailList = new List(); foreach (var detail in ls) { @@ -1715,12 +1709,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: p_InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, - tax: 0.13m, - parent: p_parentInvBillNum, - preTaxDiff: 0, - taxDiff: 0, - clientCode: "C004", - realAmt: realAmt + tax: 0.13m, + parent: p_parentInvBillNum, + preTaxDiff: 0, + taxDiff: 0, + clientCode: "C004", + realAmt: realAmt ); invbill.Site = dtos.FirstOrDefault().Site; invbill.CreationTime = DateTime.Now; @@ -1978,7 +1972,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return _invls; } - [UnitOfWork(IsDisabled = false)] + [UnitOfWork(false)] /// /// 重开一次开票 /// @@ -2279,6 +2273,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return _invls; } + [UnitOfWork(false)] /// /// 重开二次开票 ///