From fa6e8e00f4980297bbd3aee96ced0e396d3e9e67 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Mon, 11 Dec 2023 10:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index b9ded287..c9cd0a28 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1042,7 +1042,16 @@ namespace Myshipping.Application Task.Run(async () => { await Task.Delay(3000); - await UpdateMblno(entity); + try + { + await UpdateMblno(entity); + } + catch (Exception ex) + { + _logger.LogWarning($"未能成功新增运踪订阅:{entity.Id} {entity.MBLNO}"); + _logger.LogError(ex.Message); + _logger.LogError(ex.StackTrace); + } }); @@ -1137,7 +1146,11 @@ namespace Myshipping.Application lstPropName.Add(pchg.Name); } }); - await _rep.AsUpdateable(entity).UpdateColumns(lstPropName.ToArray()).ExecuteCommandAsync(); + + if (lstPropName.Count > 0) + { + await _rep.AsUpdateable(entity).UpdateColumns(lstPropName.ToArray()).ExecuteCommandAsync(); + } } //await _rep.AsUpdateable(entity).IgnoreColumns(it => new //{ @@ -1266,8 +1279,16 @@ namespace Myshipping.Application { _logger.LogWarning($"更新运踪异步方法执行"); await Task.Delay(3000); - await UpdateMblno(entity); - + try + { + await UpdateMblno(entity); + } + catch (Exception ex) + { + _logger.LogWarning($"未能成功更新运踪订阅:{entity.Id} {entity.MBLNO}"); + _logger.LogError(ex.Message); + _logger.LogError(ex.StackTrace); + } }); if (!string.IsNullOrEmpty(reqId))