|
|
@@ -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)
|