@@ -275,19 +275,6 @@ namespace Learun.Application.Web.Areas.Ask.Controllers | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => entity.Noticedept == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.Noticepeople.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
else | |||
{ | |||
@@ -295,22 +282,24 @@ namespace Learun.Application.Web.Areas.Ask.Controllers | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.Noticepeople.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
} | |||
} | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
string[] strs = entity.Noticepeople.Split(','); | |||
foreach (var uuitem in strs) | |||
{ | |||
var postids = allteacherlist.Where(m => m.F_UserId == uuitem).FirstOrDefault(); | |||
if (postids != null) | |||
{ | |||
newpostuserlist.Add(postids); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
PushWeixin(needpostuserlist, entity.T_title); | |||
//消息提醒表 | |||
@@ -163,19 +163,6 @@ namespace Learun.Application.Web.Areas.Ask.Controllers | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => entity.Noticedept == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.Noticepeople.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
else | |||
{ | |||
@@ -183,22 +170,24 @@ namespace Learun.Application.Web.Areas.Ask.Controllers | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.Noticepeople.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
} | |||
} | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
string[] strs = entity.Noticepeople.Split(','); | |||
foreach (var uuitem in strs) | |||
{ | |||
var postids = allteacherlist.Where(m => m.F_UserId == uuitem).FirstOrDefault(); | |||
if (postids !=null) | |||
{ | |||
newpostuserlist.Add(postids); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
PushWeixin(needpostuserlist, entity.T_title); | |||
//消息提醒表 | |||
@@ -285,7 +274,7 @@ namespace Learun.Application.Web.Areas.Ask.Controllers | |||
entity.TheTitle = "通知公告"; | |||
entity.TheContent = model.T_title; | |||
entity.InstanceId = model.T_id; | |||
entity.ConnectionUrl = "/Utility/ListContentIndex?id="; | |||
entity.ConnectionUrl = "/Ask/Notice_Train_Sports/ListContentIndex?id="; | |||
entity.SendTime = DateTime.Now; | |||
entity.ReadSigns = false; | |||
messageRindIBLL.SaveEntity("", entity); | |||
@@ -275,19 +275,6 @@ namespace Learun.Application.Web.Areas.Ask.Controllers | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => entity.Noticedept == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.Noticepeople.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
else | |||
{ | |||
@@ -295,22 +282,24 @@ namespace Learun.Application.Web.Areas.Ask.Controllers | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.Noticepeople.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
} | |||
} | |||
if (!string.IsNullOrEmpty(entity.Noticepeople)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
string[] strs = entity.Noticepeople.Split(','); | |||
foreach (var uuitem in strs) | |||
{ | |||
var postids = allteacherlist.Where(m => m.F_UserId == uuitem).FirstOrDefault(); | |||
if (postids != null) | |||
{ | |||
newpostuserlist.Add(postids); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
PushWeixin(needpostuserlist, entity.T_title); | |||
//消息提醒表 | |||
@@ -250,7 +250,7 @@ namespace Learun.Application.TwoDevelopment.Ask | |||
strSql.Append(" left join NoticeLog_Train_Sports r on t.T_id = r.NewsId and r.RUserId =@userId "); | |||
strSql.Append(" left join adms7ultimate2_新疆体育.dbo.lr_base_user u on u.F_UserId =@userId "); | |||
strSql.Append(" left join adms7ultimate2_新疆体育.dbo.LR_BASE_DEPARTMENT d on d.F_DepartmentId = t.Noticedept "); | |||
strSql.Append(" WHERE "); | |||
strSql.Append(" WHERE 1=1 "); | |||
//去掉用户入职时间条件 | |||
//if (userinfo.account.Contains("20")) | |||
//{ | |||
@@ -260,8 +260,9 @@ namespace Learun.Application.TwoDevelopment.Ask | |||
//strSql.Append($@" and (((t.F_SendDeptId is null or len(t.F_SendDeptId)=0) and (t.F_SendPostId is null or len(t.F_SendPostId)=0))"); | |||
if (!string.IsNullOrEmpty(deptId)) | |||
{ | |||
strSql.Append($" t.Noticedept like '%{deptId}%'"); | |||
strSql.Append($" and (t.Noticedept like '%{deptId}%' or t.Noticepeople like '%{userId}%')"); | |||
} | |||
//strSql.Append($" "); | |||
//if (!string.IsNullOrEmpty(postIds)) | |||
//{ | |||
// strSql.Append(" or (t.F_SendPostId is not null and "); | |||