Ver código fonte

通知公告下发添加个人 未完成

黑艺新账号
dyy 1 ano atrás
pai
commit
0f18d973e7
9 arquivos alterados com 151 adições e 62 exclusões
  1. +19
    -19
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DTListController.cs
  2. +49
    -34
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs
  3. +9
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/Form.cshtml
  4. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/Form.js
  5. +24
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/AuthorizeModule/UserRelation/UserRelationBLL.cs
  6. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/AuthorizeModule/UserRelation/UserRelationIBLL.cs
  7. +28
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/AuthorizeModule/UserRelation/UserRelationService.cs
  8. +14
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs
  9. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/OA_NewsMethod.cs

+ 19
- 19
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DTListController.cs Ver arquivo

@@ -65,7 +65,7 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
Pagination paginationobj = pagination.ToObject<Pagination>();

var data = dTListIBLL.GetPageList(paginationobj, queryJson);
if (paginationobj == null)
{
return JsonResult(data);
@@ -200,11 +200,20 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
dtnew = reqDataTable.Clone();
for (int i = 0; i < reqDataTable.Rows.Count; i++)
{
if (reqDataTable.Rows[i]["F_SendPostId"] != null && reqDataTable.Rows[i]["F_SendPostId"].ToString() != "")
if (reqDataTable.Rows[i]["ReceiverUserId"] != null && reqDataTable.Rows[i]["ReceiverUserId"].ToString() != "")
{
if (reqDataTable.Rows[i]["ReceiverUserId"].ToString().Contains(loginUserInfo.userId))
{
//todo:需要继续验证岗位和部门,必须三者都一致才行,否则后下角消息通知和桌面通知不一致???测试人为admin;
if (dtnew.Rows.Count < 5)
dtnew.Rows.Add(reqDataTable.Rows[i].ItemArray);
}
}
else
{
if (!string.IsNullOrEmpty(loginUserInfo.postIds))
if (reqDataTable.Rows[i]["F_SendPostId"] != null && reqDataTable.Rows[i]["F_SendPostId"].ToString() != "")
{
if (loginUserInfo.postIds.Contains(","))
if (!string.IsNullOrEmpty(loginUserInfo.postIds))
{
foreach (var postid in loginUserInfo.postIds.Split(','))
{
@@ -219,33 +228,24 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
}
}
}
else
}
else
{
if (reqDataTable.Rows[i]["F_SendDeptId"] != null && reqDataTable.Rows[i]["F_SendDeptId"].ToString() != "")
{
if (reqDataTable.Rows[i]["F_SendPostId"].ToString().Contains(loginUserInfo.postIds))
if (reqDataTable.Rows[i]["F_SendDeptId"].ToString().Contains(loginUserInfo.departmentId))
{
if (dtnew.Rows.Count < 5)
dtnew.Rows.Add(reqDataTable.Rows[i].ItemArray);
}
}
}
}
else
{
if (reqDataTable.Rows[i]["F_SendDeptId"] != null && reqDataTable.Rows[i]["F_SendDeptId"].ToString() != "")
{
if (reqDataTable.Rows[i]["F_SendDeptId"].ToString().Contains(loginUserInfo.departmentId))
else
{
if (dtnew.Rows.Count < 5)
dtnew.Rows.Add(reqDataTable.Rows[i].ItemArray);
}
}
else
{
if (dtnew.Rows.Count < 5)
dtnew.Rows.Add(reqDataTable.Rows[i].ItemArray);
}
}

}
var jsonData = new
{


+ 49
- 34
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs Ver arquivo

@@ -366,6 +366,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
{
entity.F_NewsContent = WebHelper.HtmlEncode(entity.F_NewsContent);
noticeIBLL.SaveFormAndSubmit(keyValue, entity);
if (!string.IsNullOrEmpty(keyValue))
{
entity = noticeIBLL.GetEntity(keyValue);
}
//推送通知
//读取信息推送管理-通知公告推送(01)的配置
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01");
@@ -390,60 +394,54 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
}
Task DoWeixinPush(NewsEntity entity)
{
//微信推送
try
{
var allteacherlist = userIbll.GetAllList().Where(m =>
m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师");
var userralationlist = userRelationIBLL.GetUserIdList("2");
var userralationlist = userRelationIBLL.GetUserIdListByCategory("2");
var needpostuserlist = new List<UserEntity>();
if (!string.IsNullOrEmpty(entity.F_SendDeptId))
//接收部门,下的接收岗位,下的接收人,才是需要发送消息的用户。
if (!string.IsNullOrEmpty(entity.F_SendDeptId))//部门
{
if (!entity.F_SendDeptId.Contains(","))
foreach (var senddeptid in entity.F_SendDeptId.Split(','))
{
var departteacherlist = allteacherlist.Where(m => entity.F_SendDeptId == m.F_DepartmentId);
var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId);
needpostuserlist.AddRange(departteacherlist.ToList());
if (!string.IsNullOrEmpty(entity.F_SendPostId))
}
if (!string.IsNullOrEmpty(entity.F_SendPostId))//岗位
{
var newpostuserlist = new List<UserEntity>();
foreach (var uuitem in needpostuserlist.Distinct())
{
var newpostuserlist = new List<UserEntity>();
foreach (var uuitem in needpostuserlist)
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId));
if (postids > 0)
{
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId));
if (postids > 0)
{
newpostuserlist.Add(uuitem);
}
newpostuserlist.Add(uuitem);
}
}
if (!string.IsNullOrEmpty(entity.ReceiverUserId))//人
{
var intersectUserIdList = newpostuserlist.Select(x => x.F_UserId).Intersect(entity.ReceiverUserId.Split(','));
needpostuserlist = newpostuserlist.Where(x => intersectUserIdList.Contains(x.F_UserId)).ToList();
}
else
{
needpostuserlist = newpostuserlist;
}
}
else
{
foreach (var senddeptid in entity.F_SendDeptId.Split(','))
if (!string.IsNullOrEmpty(entity.ReceiverUserId))//人
{
var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId);
needpostuserlist.AddRange(departteacherlist.ToList());
if (!string.IsNullOrEmpty(entity.F_SendPostId))
{
var newpostuserlist = new List<UserEntity>();
foreach (var uuitem in needpostuserlist)
{
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId));
if (postids > 0)
{
newpostuserlist.Add(uuitem);
}
}
needpostuserlist = newpostuserlist;
}
var intersectUserIdList = needpostuserlist.Select(x => x.F_UserId).Intersect(entity.ReceiverUserId.Split(','));
needpostuserlist = needpostuserlist.Where(x => intersectUserIdList.Contains(x.F_UserId)).ToList();
}
}
}
else
{
if (!string.IsNullOrEmpty(entity.F_SendPostId))
if (!string.IsNullOrEmpty(entity.F_SendPostId))//岗位
{
//岗位下发
var newpostuserlist = new List<UserEntity>();
foreach (var uuitem in allteacherlist)
{
@@ -453,14 +451,31 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
newpostuserlist.Add(uuitem);
}
}
needpostuserlist = newpostuserlist;
if (!string.IsNullOrEmpty(entity.ReceiverUserId))//人
{
var intersectUserIdList = newpostuserlist.Select(x => x.F_UserId).Intersect(entity.ReceiverUserId.Split(','));
needpostuserlist = newpostuserlist.Where(x => intersectUserIdList.Contains(x.F_UserId)).ToList();
}
else
{
needpostuserlist = newpostuserlist;
}
}
else
{
//全员下发
needpostuserlist = allteacherlist.ToList();
if (!string.IsNullOrEmpty(entity.ReceiverUserId))//人
{
var intersectUserIdList = allteacherlist.Select(x => x.F_UserId).Intersect(entity.ReceiverUserId.Split(','));
needpostuserlist = allteacherlist.Where(x => intersectUserIdList.Contains(x.F_UserId)).ToList();
}
else
{
//全员下发
needpostuserlist = allteacherlist.ToList();
}
}
}
//微信推送
PushWeixin(needpostuserlist, entity.F_FullHead);

//消息提醒表


+ 9
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/Form.cshtml Ver arquivo

@@ -24,19 +24,23 @@
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">来源地址</div>
<input id="F_SourceAddress" type="text" class="form-control" />
</div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">接收部门</div>
<div id="F_SendDeptId"></div>
</div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">接收岗位</div>
<div id="F_SendPostId"></div>
</div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">接收人</div>
<div id="ReceiverUserId"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">下发飞星</div>
<div id="F_IsSendFX"></div>
</div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">标题图片</div>
<div id="F_NewsImage"></div>
@@ -45,7 +49,7 @@
<div class="lr-form-item-title">公告内容</div>
<div id="editor" style="height:300px;"></div>
@*<script id="editor" type="text/plain" style="height:270px;">
</script>*@
</script>*@
</div>
</div>



+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/Form.js Ver arquivo

@@ -28,6 +28,7 @@ var bootstrap = function ($, learun) {
$('#F_IsSendFX').lrDataItemSelect({ code: 'YesOrNoBit' });
$('#F_SendDeptId').lrDepartmentSelect({ type: 'treemultiple' });
$('#F_SendPostId').lrPostSelect({ type: 'treemultiple' });
$('#ReceiverUserId').lrUserSelect({ type: '1' });
//内容编辑器
ue = UE.getEditor('editor');
},


+ 24
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/AuthorizeModule/UserRelation/UserRelationBLL.cs Ver arquivo

@@ -171,6 +171,30 @@ namespace Learun.Application.Base.AuthorizeModule
}
}
}

/// <summary>
/// 获取用户主键列表信息
/// </summary>
/// <param name="category">分类:1-角色2-岗位</param>
/// <returns></returns>
public IEnumerable<UserRelationEntity> GetUserIdListByCategory(string category)
{
try
{
return userRelationService.GetUserIdListByCategory(category);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

#region 提交数据


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/AuthorizeModule/UserRelation/UserRelationIBLL.cs Ver arquivo

@@ -43,6 +43,12 @@ namespace Learun.Application.Base.AuthorizeModule
IEnumerable<UserRelationEntity> GetUserIdList(List<string> objectIdList);

IEnumerable<PostEntity> GetEntityNameByUserId(string keyValue);
/// <summary>
/// 获取用户主键列表信息
/// </summary>
/// <param name="category">分类:1-角色2-岗位</param>
/// <returns></returns>
IEnumerable<UserRelationEntity> GetUserIdListByCategory(string category);
#endregion

#region 提交数据


+ 28
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/AuthorizeModule/UserRelation/UserRelationService.cs Ver arquivo

@@ -154,6 +154,34 @@ namespace Learun.Application.Base.AuthorizeModule
}
}
}

/// <summary>
/// 获取用户主键列表信息
/// </summary>
/// <param name="category">分类:1-角色2-岗位</param>
/// <returns></returns>
public IEnumerable<UserRelationEntity> GetUserIdListByCategory(string category)
{
try
{
var strSql = new StringBuilder();
strSql.Append(" SELECT ");
strSql.Append(fieldSql);
strSql.Append(" FROM LR_Base_UserRelation t WHERE t.F_Category = @category");
return this.BaseRepository().FindList<UserRelationEntity>(strSql.ToString(), new { category = category });
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region 提交数据


+ 14
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs Ver arquivo

@@ -174,13 +174,24 @@ namespace Learun.Application.OA

[Column("F_NEWSIMAGE")]
public string F_NewsImage { get; set; }

/// <summary>
/// 接收部门
/// </summary>
[Column("F_SENDDEPTID")]
public string F_SendDeptId { get; set; }

/// <summary>
/// 接收岗位
/// </summary>
[Column("F_SENDPOSTID")]
public string F_SendPostId { get; set; }

/// <summary>
/// 接收人
/// </summary>
[Column("RECEIVERUSERID")]
public string ReceiverUserId { get; set; }
/// <summary>
/// 下发飞星
/// </summary>
[Column("F_ISSENDFX")]
public bool? F_IsSendFX { get; set; }
/// <summary>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/OA_NewsMethod.cs Ver arquivo

@@ -68,7 +68,7 @@ namespace Learun.Application.WorkFlow
{
var allteacherlist = userIbll.GetAllList().Where(m =>
m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师");
var userralationlist = userRelationIBLL.GetUserIdList("2");
var userralationlist = userRelationIBLL.GetUserIdListByCategory("2");
var needpostuserlist = new List<UserEntity>();
if (!string.IsNullOrEmpty(entity.F_SendDeptId))
{


Carregando…
Cancelar
Salvar