From e0f2b29f3349d43e7f4222e079c54ba9cc4b6ee1 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期一, 16 六月 2025 11:09:23 +0800 Subject: [PATCH] fix:支付回调及供应商回调并发问题修订 --- LifePayment/LifePayment.Application/Sync/SyncService.cs | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/LifePayment/LifePayment.Application/Sync/SyncService.cs b/LifePayment/LifePayment.Application/Sync/SyncService.cs index e2c3a83..adc9412 100644 --- a/LifePayment/LifePayment.Application/Sync/SyncService.cs +++ b/LifePayment/LifePayment.Application/Sync/SyncService.cs @@ -482,13 +482,13 @@ } else { - var updateTargetLifePayChannles = new SyncLifePayChannles(); - ObjectMapper.Map(sourceLifePayChannles, updateTargetLifePayChannles); - updateTargetLifePayChannles.Id = targetLifePayChannles.Id; - await UpdateLifePayChannles(targetConnName, updateTargetLifePayChannles); - targetLifePayChannles = updateTargetLifePayChannles; - dicChannleIds.Add(sourceLifePayChannles.Id, targetLifePayChannles.Id); - logger.LogInformation($"宸叉洿鏂版笭閬擄細{targetLifePayChannles.ChannlesName}"); + //var updateTargetLifePayChannles = new SyncLifePayChannles(); + //ObjectMapper.Map(sourceLifePayChannles, updateTargetLifePayChannles); + //updateTargetLifePayChannles.Id = targetLifePayChannles.Id; + //await UpdateLifePayChannles(targetConnName, updateTargetLifePayChannles); + //targetLifePayChannles = updateTargetLifePayChannles; + //dicChannleIds.Add(sourceLifePayChannles.Id, targetLifePayChannles.Id); + //logger.LogInformation($"宸叉洿鏂版笭閬擄細{targetLifePayChannles.ChannlesName}"); } } catch (Exception ex) @@ -498,39 +498,39 @@ } } - foreach (var sourceLifePayChannlesRake in sourceLifePayChannlesRakeList) + foreach (var sourceLifePayOrder in sourceLifePayOrderList) { try { - var targetLifePayChannlesRake = targetLifePayChannlesRakeList.FirstOrDefault(it => it.Id == sourceLifePayChannlesRake.Id); - if (targetLifePayChannlesRake == null) + var targetLifePayOrder = targetLifePayOrderList.FirstOrDefault(it => it.Id == sourceLifePayOrder.Id); + if (targetLifePayOrder == null) { - targetLifePayChannlesRake = new SyncLifePayChannlesRake(); - ObjectMapper.Map(sourceLifePayChannlesRake, targetLifePayChannlesRake); - if (sourceLifePayChannlesRake.UserId.HasValue) + targetLifePayOrder = new SyncLifePayOrder(); + ObjectMapper.Map(sourceLifePayOrder, targetLifePayOrder); + if (sourceLifePayOrder.UserId.HasValue) { - targetLifePayChannlesRake.UserId = dicUserIds[sourceLifePayChannlesRake.UserId]; + targetLifePayOrder.UserId = dicUserIds[sourceLifePayOrder.UserId]; } - await InsertLifePayChannlesRake(targetConnName, targetLifePayChannlesRake); - logger.LogInformation($"宸叉彃鍏ュ垎浣o細{targetLifePayChannlesRake.OrderNo}"); + await InsertLifePayOrder(targetConnName, targetLifePayOrder); + logger.LogInformation($"宸叉彃鍏ヨ鍗曪細{targetLifePayOrder.OrderNo}"); } else { - targetLifePayChannlesRake = new SyncLifePayChannlesRake(); - ObjectMapper.Map(sourceLifePayChannlesRake, targetLifePayChannlesRake); - if (sourceLifePayChannlesRake.UserId.HasValue) + targetLifePayOrder = new SyncLifePayOrder(); + ObjectMapper.Map(sourceLifePayOrder, targetLifePayOrder); + if (sourceLifePayOrder.UserId.HasValue) { - targetLifePayChannlesRake.UserId = dicUserIds[sourceLifePayChannlesRake.UserId]; + targetLifePayOrder.UserId = dicUserIds[sourceLifePayOrder.UserId]; } - await UpdateLifePayChannlesRake(targetConnName, targetLifePayChannlesRake); - logger.LogInformation($"宸叉洿鏂板垎浣o細{targetLifePayChannlesRake.OrderNo}"); + await UpdateLifePayOrder(targetConnName, targetLifePayOrder); + logger.LogInformation($"宸叉洿鏂拌鍗曪細{targetLifePayOrder.OrderNo}"); } } catch (Exception ex) { - messages.Add($"鏈兘鍚屾鍒嗕剑锛坽sourceLifePayChannlesRake.OrderNo}锛夊彂鐢熸湇鍔″櫒寮傚父锛歿ex.Message}"); + messages.Add($"鏈兘鍚屾鍒嗕剑锛坽sourceLifePayOrder.OrderNo}锛夊彂鐢熸湇鍔″櫒寮傚父锛歿ex.Message}"); continue; } } -- Gitblit v1.9.1