From 6b24ae48c664c25676672ece72d134474c6af817 Mon Sep 17 00:00:00 2001 From: liaoxujun@qq.com <liaoxujun@qq.com> Date: 星期二, 12 九月 2023 15:00:23 +0800 Subject: [PATCH] 消息发送 --- DocumentServiceApi.InitQMessage/MessageReceive.cs | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff --git a/DocumentServiceApi.InitQMessage/MessageReceive.cs b/DocumentServiceApi.InitQMessage/MessageReceive.cs index f250681..272bf15 100644 --- a/DocumentServiceApi.InitQMessage/MessageReceive.cs +++ b/DocumentServiceApi.InitQMessage/MessageReceive.cs @@ -8,6 +8,7 @@ using Furion.Schedule; using InitQ.Abstractions; using InitQ.Attributes; +using InitQ.Cache; using Microsoft.Extensions.Options; using SqlSugar; using System; @@ -23,8 +24,12 @@ /// </summary> public class MessageReceive: IRedisSubscribe { - - + private InitQ.Cache.ICacheService _cacheService; + public MessageReceive(InitQ.Cache.ICacheService cacheService) + { + _cacheService = cacheService; + } + /// <summary> /// 鍒濆鍖栬鍗曞鐞� /// </summary> @@ -55,6 +60,8 @@ PayTime = obj.PayTime, ZcUserID = obj.ZcUserID, ITCode = obj.ITCode, + HasDocumentPermission=obj.HasDocumentPermission + }; TenantInfo? Tinfo = await _db.Queryable<TenantInfo>().Where(x=>x.ZcUserID==obj.ZcUserID).SingleAsync(); if(Tinfo==null) @@ -66,7 +73,7 @@ CreatBy = "娑堟伅闃熷垪 InitTenantOder", CreatTime = DateTime.Now, Description = obj.Description, - Name = obj.Name??obj.ITCode+"闆嗗洟璐﹀彿", + Name =obj.TenantName , PsW = obj.ITCode.Substring(obj.ITCode.Length - 4), @@ -78,6 +85,8 @@ Description = obj.Description, EmployeeMaxCount = obj.EmployeeCount ?? 0, UnitMaxCount = obj.UnitCount ?? 0, + + HasDocumentPermission=obj.HasDocumentPermission, OverTime = DateTime.Now.AddMonths(obj.MonthCount ?? 0), @@ -107,7 +116,7 @@ Document_TenderUnit tenderUnit = new Document_TenderUnit() { - UnitName = obj.Name ?? "闆嗗洟鍏徃", + UnitName = obj.TenantName ?? "闆嗗洟鍏徃", AdviseFlag = 2, UserId = 0, CreatTime = DateTime.Now.ToString("yyyy MM dd"), @@ -235,5 +244,19 @@ } + /// <summary> + /// 鍙戦�佹秷鎭粰鐢ㄦ埛涓紝鐢ㄦ埛涓績浼氬搷搴旇繖涓秷鎭� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [SubscribeDelay(INITQMessageDefine.DTSendMessage)] + private async Task SendMessage(string msg) + { + + await _cacheService.ListRightPushAsync(INITQMessageDefine.DTSendMessage, msg); + } + } + + } -- Gitblit v1.9.1