Kaynağa Gözat

公告消息

liyuanyuan 1 yıl önce
ebeveyn
işleme
af3447a0b1

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

@@ -2,6 +2,7 @@
2 2
 using CallCenterApi.Common;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Model;
5 6
 using System;
6 7
 using System.Collections.Generic;
7 8
 using System.Data;
@@ -14,6 +15,7 @@ namespace CallCenterApi.Interface.Controllers.information
14 15
     //[Authority]
15 16
     public class NoticeController : BaseController
16 17
     {
18
+        private information.InternalMessagesController msg = new information.InternalMessagesController();
17 19
         BLL.T_Msg_NoticeInfo dBLL = new BLL.T_Msg_NoticeInfo();
18 20
         private BLL.T_Sys_RoleInfo rolebll = new BLL.T_Sys_RoleInfo();
19 21
         /// <summary>
@@ -275,8 +277,46 @@ namespace CallCenterApi.Interface.Controllers.information
275 277
             dModel.F_UserId = "," + userid + ",";
276 278
             dModel.F_CreateOn = DateTime.Now;
277 279
             dModel.F_CreateBy = int.Parse(User.UserData["F_UserID"]);
278
-
279 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 320
             if (b > 0)
281 321
             {
282 322
                 return Success("添加成功");
@@ -297,6 +337,8 @@ namespace CallCenterApi.Interface.Controllers.information
297 337
             if (nid != null && nid.Trim() != "")
298 338
             {
299 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 342
                 if (dModel != null)
301 343
                 {
302 344
                     if (title != null)

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

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