/// <summary> /// 用户A收到B已读阅后即焚的通知需要发送回执 /// </summary> public static void SendBurnAfterReadReceipt(BurnAfterReadReceiptCtt msg, string messageID) { //BurnAfterReadReceipt receipt = new BurnAfterReadReceipt(); //receipt.ctt = new BurnAfterReadReceiptCtt(); //receipt.ctt.sendUserId = AntSdkService.AntSdkCurrentUserInfo.userId; //receipt.ctt.companyCode = GlobalVariable.CompanyCode; //receipt.ctt.chatIndex = msg.chatIndex; //receipt.ctt.os = ((int)GlobalVariable.OSType.PC).ToString(); //receipt.ctt.sessionId = msg.sessionId; //receipt.ctt.targetId = null; //receipt.ctt.content = null; string errMsg = string.Empty; //TODO:AntSdk_Modify //DNOE:AntSdk_Modify var burnRead = new AntSdkSendMsg.PointBurnReaded { targetId = msg.targetId, chatIndex = msg.chatIndex, sessionId = msg.sessionId, sendUserId = AntSdkService.AntSdkCurrentUserInfo.userId, messageId = PublicTalkMothed.timeStampAndRandom(), chatType = (int)AntSdkchatType.Point, os = (int)GlobalVariable.OSType.PC, content = new AntSdkSendMsg.PointBurnReaded_content { readIndex = int.Parse(msg.chatIndex), //TODO://收到的那条阅后即焚消息的messageId messageId = messageID } }; AntSdkService.SdkPublishPointBurnReadReceiptMsg(burnRead, ref errMsg); //MqttService.Instance.Publish<BurnAfterReadReceipt>(GlobalVariable.TopicClass.MessageRead, receipt, ref errMsg, NullValueHandling.Ignore); }
/// <summary> /// 发送消息 /// </summary> /// <param name="o"></param> private void SendMassMsg(object o) { if (ContactUsers == null || ContactUsers.Count == 0) { MessageBoxWindow.Show("请先选择消息接收人!", GlobalVariable.WarnOrSuccess.Warn); return; } else if (string.IsNullOrWhiteSpace(MsgContent)) { MessageBoxWindow.Show("消息内容不能为空!", GlobalVariable.WarnOrSuccess.Warn); return; } else if (MsgContent.Length > 500) { MessageBoxWindow.Show("消息内容不能超过500个字符!", GlobalVariable.WarnOrSuccess.Warn); return; } MassMsg msg = new MassMsg(); msg.mtp = (int)GlobalVariable.MsgType.MassMsg; //TODO:AntSdk_Modify AntSdkMassMsgCtt ctt = new AntSdkMassMsgCtt(); //ctt.messageId = PublicTalkMothed.timeStampAndRandom(); ctt.sendUserId = AntSdkService.AntSdkCurrentUserInfo.userId; if (ContactUsers != null && ContactUsers.Count > 0) { ctt.targetId = string.Join(",", ContactUsers.Where(m => m.userId != AntSdkService.AntSdkCurrentUserInfo.userId).Select(c => c.userId).ToArray()); } ctt.companyCode = GlobalVariable.CompanyCode; ctt.content = MsgContent; ctt.os = (int)GlobalVariable.OSType.PC; ctt.sessionId = DataConverter.GetSessionID(AntSdkService.AntSdkCurrentUserInfo.userId, GlobalVariable.MassAssistantId); ctt.chatIndex = null; ctt.sendTime = null; string errMsg = ""; //DONE:AntSdk_Modify AntSdkChatMsg.MultiSend massMsg = new AntSdkChatMsg.MultiSend(); massMsg.sendUserId = AntSdkService.AntSdkCurrentUserInfo.userId; if (ContactUsers != null && ContactUsers.Count > 0) { massMsg.targetId = string.Join(",", ContactUsers.Where(m => m.userId != AntSdkService.AntSdkCurrentUserInfo.userId).Select(c => c.userId).ToArray()); } massMsg.content = MsgContent; massMsg.chatType = (int)AntSdkchatType.Point; massMsg.messageId = PublicTalkMothed.timeStampAndRandom(); massMsg.sessionId = DataConverter.GetSessionID(AntSdkService.AntSdkCurrentUserInfo.userId, GlobalVariable.MassAssistantId); var isResult = AntSdkService.SdkPublishChatMsg(massMsg, ref errMsg); // AntSdkMassMsgCtt if (isResult) { ctt.messageId = massMsg.messageId; LogHelper.WriteWarn("---------------------------消息助手群发消息已发送---------------------"); SendMassMsgEvent?.Invoke(ctt); (o as System.Windows.Window)?.Close(); } else { MessageBoxWindow.Show("消息发送失败!" + errMsg, GlobalVariable.WarnOrSuccess.Warn); } }