From 4dc91006797c1bd98366c37d2c6e2aac241d7298 Mon Sep 17 00:00:00 2001 From: mahao Date: Thu, 2 Mar 2023 14:31:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OtherZll/OtherZllService.cs | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/WmsWebApi.Application/OtherZll/OtherZllService.cs b/src/WmsWebApi.Application/OtherZll/OtherZllService.cs index 942472d..e5fb1cf 100644 --- a/src/WmsWebApi.Application/OtherZll/OtherZllService.cs +++ b/src/WmsWebApi.Application/OtherZll/OtherZllService.cs @@ -304,26 +304,18 @@ public class OtherZllService : ApplicationService, IOtherZllService } if (!bErr) { - try - { - if (_recieveList.Count > 0) - { - await _tbBillRepository.AddManyAsync(_billList); - await _tbProductReceiveRepository.AddAsync(_recieveList); - } - if (_stockList != null && _stockList.Count() > 0) - await _tsStockDetailRepository.AddAsync(_stockList); - if (_stockUpdateList != null && _stockUpdateList.Count() > 0) - await _tmPgWmsUpdate.UpdateTsStock(_stockUpdateList); - if (_stockDelList != null && _stockDelList.Count() > 0) - await _tmPgWmsUpdate.DeleteTsStock(_stockDelList); - await _tlTransactionRepository.AddAsync(_transList); - } - catch (Exception ex) + if (_recieveList.Count > 0) { - dto.ITYPE = ex.GetBaseException().Message; - throw new Exception("操作数据库失败,请稍后重试。", ex); + await _tbBillRepository.AddManyAsync(_billList); + await _tbProductReceiveRepository.AddAsync(_recieveList); } + if (_stockList != null && _stockList.Count() > 0) + await _tsStockDetailRepository.AddAsync(_stockList); + if (_stockUpdateList != null && _stockUpdateList.Count() > 0) + await _tmPgWmsUpdate.UpdateTsStock(_stockUpdateList); + if (_stockDelList != null && _stockDelList.Count() > 0) + await _tmPgWmsUpdate.DeleteTsStock(_stockDelList); + await _tlTransactionRepository.AddAsync(_transList); } } else @@ -355,7 +347,7 @@ public class OtherZllService : ApplicationService, IOtherZllService await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.OtherZllAdd, content.ToString()); } - throw; + throw new Exception("操作数据库失败,稍后系统自动重试。", ex); } finally {