diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
index bd9f1bca..92e85883 100644
--- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
+++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
@@ -1957,7 +1957,7 @@ namespace Myshipping.Application
}
}
//记录日志
- await SaveLog(entity, mlist, "保存");
+ await SaveLog(entity, mlist, "保存", lstPropName);
if (!string.IsNullOrEmpty(entity.MBLNO) && !string.IsNullOrEmpty(entity.YARDID) && (entity.MBLNO != mlist.MBLNO || entity.YARDID != mlist.YARDID || entity.CARRIERID != mlist.CARRIERID))
{
_logger.LogInformation($"数据有变化,更新运踪订阅");
@@ -9694,7 +9694,7 @@ namespace Myshipping.Application
_logger.LogInformation($"开始{logTitle}");
var itemcode = App.Configuration["ITEMCODE"].ToString();
var BookingOrderMQUri = App.Configuration["SendBookingOrderMQUri"];
- _logger.LogInformation($"{logTitle}订舱数据回推地址:{BookingOrderMQUri},itemcode:{itemcode}" );
+ _logger.LogInformation($"{logTitle}订舱数据回推地址:{BookingOrderMQUri},itemcode:{itemcode}");
if (!string.IsNullOrEmpty(itemcode) && itemcode == "True")
{
if (ids.Count() == 0)
@@ -9714,6 +9714,7 @@ namespace Myshipping.Application
//2023-9-26,添加校验:推送前通过Cache判断一下待推送的数据是否正在走删除逻辑
if (await _cache.ExistsAsync($"DeletingBookingOrderId_{item.Id}"))
{
+ _logger.LogInformation($"Id:{item.Id},正在走删除逻辑,continue跳过");
continue;
}
@@ -10113,7 +10114,7 @@ namespace Myshipping.Application
///
///
[NonAction]
- public async Task SaveLog(BookingOrder newOrder, BookingOrder oldOrder, string fromFunc)
+ public async Task SaveLog(BookingOrder newOrder, BookingOrder oldOrder, string fromFunc, List updateFields = null)
{
bool flag = true;
long bid = 0;
@@ -10125,6 +10126,11 @@ namespace Myshipping.Application
{
continue;
}
+ // 如果已经明确了被修改的字段,且当前字段不在其中,则跳过
+ if (updateFields != null && !updateFields.Contains(name))
+ {
+ continue;
+ }
object value = descriptor.GetValue(newOrder);
var oldvalue = oldOrder.GetType().GetProperty(name).GetValue(oldOrder, null);
//数值类型转换比较
diff --git a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs
index 5effc4df..54879701 100644
--- a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs
+++ b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs
@@ -78,8 +78,10 @@ namespace Myshipping.Application
///
///
///
+ /// 日志操作来源
+ /// 明确的被修改的字段
///
- Task SaveLog(BookingOrder newOrder, BookingOrder oldOrder, string fromFunc);
+ Task SaveLog(BookingOrder newOrder, BookingOrder oldOrder, string fromFunc, List updateFields = null);
Task AutoYardData(long bookId);