Browse Source

Merge branch 'release_20250418tj' of Fengwo/hotline into release

修复短信状态回调状态处理
tangjiang 1 week ago
parent
commit
74c3bc535b

+ 7 - 4
src/Hotline.Application/OrderApp/Handlers/OrderHandler/OrderVisitSmsHandler.cs

@@ -39,12 +39,15 @@ public class OrderVisitSmsHandler : INotificationHandler<ReceiveMessageNotify>
             .Where(m => m.SendState == ESendState.Success)
             .OrderByDescending(m => m.CreationTime)
             .FirstAsync(cancellationToken);
-        if (msg.SendTime!.Value.AddDays(2) < DateTime.Now)
+        if (msg != null)
         {
-            _logRepository.Add("短信回访-不处理", notification, "msg.SendTime 已经超过2天, 不处理", "OrderVisitSmsHandler", 0);
-            return;
+            if (msg.SendTime!.Value.AddDays(2) < DateTime.Now)
+            {
+                _logRepository.Add("短信回访-不处理", notification, "msg.SendTime 已经超过2天, 不处理", "OrderVisitSmsHandler", 0);
+                return;
+            }
+            await _orderVisitDomainService.UpdateSmsReplyAsync(notification.NotifyDto);
         }
-        await _orderVisitDomainService.UpdateSmsReplyAsync(notification.NotifyDto);
     }
 }
 

+ 3 - 0
src/Hotline/Push/FWMessage/PushDomainService.cs

@@ -145,6 +145,8 @@ public class PushDomainService : IPushDomainService, IScopeDependency
                     }
                     else
                         data.Status = EPushStatus.Failed;
+
+                    await _messageRepository.UpdateAsync(data, cancellation);
                 }
                 else if (dto.Type == "1")
                 {
@@ -152,6 +154,7 @@ public class PushDomainService : IPushDomainService, IScopeDependency
                     data.SendState = dto.SendState;
                     data.MsgCount = dto.MsgCount;
                     data.SmsSendingCompletedId = dto.SmsSendingCompletedId;
+                    await _messageRepository.UpdateAsync(data, cancellation);
                 }
 
             }