Browse Source

公告消息

liyuanyuan 1 year ago
parent
commit
af3447a0b1

+ 43 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/information/NoticeController.cs

2
 using CallCenterApi.Common;
2
 using CallCenterApi.Common;
3
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Model;
5
 using System;
6
 using System;
6
 using System.Collections.Generic;
7
 using System.Collections.Generic;
7
 using System.Data;
8
 using System.Data;
14
     //[Authority]
15
     //[Authority]
15
     public class NoticeController : BaseController
16
     public class NoticeController : BaseController
16
     {
17
     {
18
+        private information.InternalMessagesController msg = new information.InternalMessagesController();
17
         BLL.T_Msg_NoticeInfo dBLL = new BLL.T_Msg_NoticeInfo();
19
         BLL.T_Msg_NoticeInfo dBLL = new BLL.T_Msg_NoticeInfo();
18
         private BLL.T_Sys_RoleInfo rolebll = new BLL.T_Sys_RoleInfo();
20
         private BLL.T_Sys_RoleInfo rolebll = new BLL.T_Sys_RoleInfo();
19
         /// <summary>
21
         /// <summary>
275
             dModel.F_UserId = "," + userid + ",";
277
             dModel.F_UserId = "," + userid + ",";
276
             dModel.F_CreateOn = DateTime.Now;
278
             dModel.F_CreateOn = DateTime.Now;
277
             dModel.F_CreateBy = int.Parse(User.UserData["F_UserID"]);
279
             dModel.F_CreateBy = int.Parse(User.UserData["F_UserID"]);
278
-
279
             int b = dBLL.Add(dModel);
280
             int b = dBLL.Add(dModel);
281
+            // 添加未读的记录
282
+            if (string.IsNullOrEmpty(roleid) && string.IsNullOrEmpty(userid)) {
283
+                List<T_Sys_UserAccount> userlist = new BLL.T_Sys_UserAccount().GetModelList("F_DeleteFlag=0");
284
+                foreach (T_Sys_UserAccount item in userlist)
285
+                {
286
+                    msg.AddInternalMessagesInfo(title.Trim(), b.ToString(), item.F_UserCode, User.UserData["F_UserCode"], (int)EnumSmsType.notice);
287
+                }
288
+            }
289
+
290
+           else if (!string.IsNullOrEmpty(userid))
291
+            {
292
+
293
+                string[] struser = userid.Split(',');
294
+                foreach (string item in struser)
295
+                {
296
+                   
297
+                    if (!string.IsNullOrEmpty(item))
298
+                    {
299
+                        int uuuid = Convert.ToInt32(item);
300
+                        T_Sys_UserAccount usermodel = new BLL.T_Sys_UserAccount().GetModel(uuuid);
301
+                        if (usermodel != null) {
302
+                            msg.AddInternalMessagesInfo(title.Trim(), b.ToString(), usermodel.F_UserCode, User.UserData["F_UserCode"], (int)EnumSmsType.notice);
303
+                        }
304
+                  
305
+                    }
306
+                }
307
+
308
+
309
+            }
310
+            else if (!string.IsNullOrEmpty(roleid)) {
311
+
312
+                  List<T_Sys_UserAccount> userlist= new BLL.T_Sys_UserAccount().GetModelList(" F_RoleId=" + Convert.ToInt32(roleid) + "and F_DeleteFlag=0");
313
+                foreach (T_Sys_UserAccount item in userlist)
314
+                {
315
+                    msg.AddInternalMessagesInfo(title.Trim(), b.ToString(), item.F_UserCode, User.UserData["F_UserCode"], (int)EnumSmsType.notice);
316
+                }
317
+            }
318
+
319
+        
280
             if (b > 0)
320
             if (b > 0)
281
             {
321
             {
282
                 return Success("添加成功");
322
                 return Success("添加成功");
297
             if (nid != null && nid.Trim() != "")
337
             if (nid != null && nid.Trim() != "")
298
             {
338
             {
299
                 Model.T_Msg_NoticeInfo dModel = dBLL.GetModel(int.Parse(nid.Trim()));
339
                 Model.T_Msg_NoticeInfo dModel = dBLL.GetModel(int.Parse(nid.Trim()));
340
+                string olduserid = dModel.F_UserId;
341
+                string oldroleid = dModel.F_RoleId;
300
                 if (dModel != null)
342
                 if (dModel != null)
301
                 {
343
                 {
302
                     if (title != null)
344
                     if (title != null)

+ 4 - 3
CallCenterApi/CallCenterApi.Model/T_SMS_InternalMessages.cs

121
             get { return _sms_istop; }
121
             get { return _sms_istop; }
122
         }
122
         }
123
         /// <summary>
123
         /// <summary>
124
-        /// 类型:0消息,1工单,2知识库 3 超期等提醒 需要弹框的
124
+        /// 类型:0消息,1工单,2知识库 3 超期等提醒 需要弹框的,5 通知公告
125
         /// </summary>
125
         /// </summary>
126
         public int? SMS_Type
126
         public int? SMS_Type
127
         {
127
         {
132
     }
132
     }
133
 
133
 
134
     /// <summary>
134
     /// <summary>
135
-    /// 消息类型:1工单,2知识库,3催办工单 4 
135
+    /// 消息类型:1工单,2知识库,3催办工单 4 ,5 是公告
136
     /// </summary>
136
     /// </summary>
137
     public enum EnumSmsType
137
     public enum EnumSmsType
138
     {
138
     {
140
         workorder,
140
         workorder,
141
         knowledge,
141
         knowledge,
142
         additional,
142
         additional,
143
-        attention
143
+        attention,
144
+        notice
144
 
145
 
145
     }
146
     }
146
 }
147
 }