From d1637e7fe7386ed160f2cbcb44e8c5f5d67d5813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 23 Aug 2023 13:08:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/BBAC_PD_DTO.cs | 2 +- .../Entities/BQ/Managers/INV_MNG.cs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs index 1a6924f8..ad056fcc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs @@ -153,7 +153,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string Extend3 { get; set; } /// - /// 扩展字段4 + /// 客户零件号 /// public string Extend4 { get; set; } 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 60946852..46b2d704 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 @@ -23,6 +23,7 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Volo.Abp.Json; +using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.CodeSettings; @@ -152,6 +153,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// + [UnitOfWork(false)] public virtual async Task SetForwardState(List p_invs, SettleBillState p_State) { List errors = new List(); @@ -167,7 +169,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (nols.Count > 0) { var invs = nols.Select(p => p.InvbillNum); - throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); + throw new BusinessException("8989",$"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); } var state = p_State; switch (p_State) @@ -230,7 +232,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers break; } - await _repository.BatchUpdateAsync(appls); + await _repository.DbContext.BulkUpdateAsync(appls); return true; } @@ -263,7 +265,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (nols.Count > 0) { var invs = nols.Select(p => p.InvbillNum); - throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); + throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作","400"); } var state = p_State; switch (p_State) @@ -388,11 +390,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { throw new UserFriendlyException($"发票不属于一个发票分组"); } - var lostlist = invList.Where(p => p.InvoiceState == InvoiceBillState.报废 || p.State ==SettleBillState.客户已收票).ToList(); + var lostlist = invList.Where(p => p.InvoiceState == InvoiceBillState.报废 || p.State !=SettleBillState.财务已审核).ToList(); if (lostlist.Count > 0) { var invs=lostlist.Select(p => p.InvbillNum).ToList(); - throw new UserFriendlyException($"发票{string.Join(",",invs)}已经报废或客户已收票!"); + throw new UserFriendlyException($"发票{string.Join(",",invs)}已经报废或不是财务审核状态!","400"); } var inv = invList.FirstOrDefault(); if (inv.BusinessType == EnumBusinessType.JisBBAC) @@ -401,7 +403,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (pdlist != null && pdlist.Count > 0) { var invs = pdlist.Select(p => p.BillNum).ToList(); - throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交"); + throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交","400"); } var parentList = invList.Select(p => p.ParentInvbillNum).ToList();//所有发票存在父发票号 List oldinvs = new List();