tangjiang 10 mesi fa
parent
commit
f9aa4e427b
1 ha cambiato i file con 19 aggiunte e 13 eliminazioni
  1. 19 13
      src/yibin/Push.YiBin/PushDomainService.cs

+ 19 - 13
src/yibin/Push.YiBin/PushDomainService.cs

@@ -67,6 +67,7 @@ public class PushDomainService : IPushDomainService, IScopeDependency
 
     #endregion
 
+    #region 短信发送---新版
     /// <summary>
     /// 短信写入待发表
     /// </summary>
@@ -157,8 +158,7 @@ public class PushDomainService : IPushDomainService, IScopeDependency
         }
         return message;
     }
-
-
+    #endregion
 
     #region 短信发送
 
@@ -214,12 +214,12 @@ public class PushDomainService : IPushDomainService, IScopeDependency
 
         await _messageRepository.AddAsync(message, cancellation); //写入本地数据库
 
-        if (message.ClientId == "Hotline")
-        {
-            var data = _mapper.Map<PushMessageDto>(message);
-            data.Type = "0";
-            await _capPublisher.PublishAsync(Push.Share.EventNames.UpdateSendSmsState, data, cancellationToken: cancellation);
-        }
+        //if (message.ClientId == "Hotline")
+        //{
+        //    var data = _mapper.Map<PushMessageDto>(message);
+        //    data.Type = "0";
+        //    await _capPublisher.PublishAsync(Push.Share.EventNames.UpdateSendSmsState, data, cancellationToken: cancellation);
+        //}
     }
 
     #endregion
@@ -307,7 +307,6 @@ public class PushDomainService : IPushDomainService, IScopeDependency
             catch (Exception)
             {
 
-                throw;
             }
         }
         // 成功返回值必须是ok
@@ -349,11 +348,18 @@ public class PushDomainService : IPushDomainService, IScopeDependency
             data.SmsReplyTime = Convert.ToDateTime(receiveMessageDto.motime);
             data.SmsReplyContent = receiveMessageDto.msg;
             await _messageRepository.UpdateAsync(data);
-            if (data.ClientId == "Hotline")
+            try
             {
-                var dataPush = _mapper.Map<PushMessageDto>(data);
-                dataPush.Type = "2";
-                await _capPublisher.PublishAsync(Push.Share.EventNames.UpdateSendSmsState, dataPush, cancellationToken: default);
+                if (data.ClientId == "Hotline")
+                {
+                    var dataPush = _mapper.Map<PushMessageDto>(data);
+                    dataPush.Type = "2";
+                    await _fwClient.RequestNoTokenAsync<Reponse>("api/v1/PushMessage/update-send-sms-state", "Post", System.Text.Json.JsonSerializer.Serialize(dataPush), cancellationToken: default);
+                }
+            }
+            catch (Exception)
+            {
+
             }
         }