diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs index 0fa32d7a2..80bc359df 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.LR_Desktop; using System.Web.Mvc; using System.Collections.Generic; +using System.Collections; namespace Learun.Application.Web.Areas.LR_Desktop.Controllers { @@ -26,7 +27,16 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); + } + /// + /// 未读消息页面 + /// + /// + [HttpGet] + public ActionResult UnreadIndex() + { + return View(); } /// /// 表单页 @@ -35,7 +45,7 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -62,6 +72,33 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers }; return Success(jsonData); } + + /// + /// 获取未读的消息 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetListForUnread() + { + var data = messageRindIBLL.GetListForUnread(); + List list = new List(); + foreach (var entity in data) + { + Hashtable ht = new Hashtable(); + ht["MessageId"] = entity.MessageId; + ht["SenderName"] = entity.SenderName; + ht["TheTitle"] = entity.TheTitle; + ht["TheContent"] = entity.TheContent; + ht["ConnectionUrl"] = entity.ConnectionUrl; + ht["InstanceId"] = entity.InstanceId; + list.Add(ht); + } + return ToJsonResult(list); + } + /// /// 获取表单数据 /// @@ -71,8 +108,9 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var MessageRemindData = messageRindIBLL.GetMessageRemindEntity( keyValue ); - var jsonData = new { + var MessageRemindData = messageRindIBLL.GetMessageRemindEntity(keyValue); + var jsonData = new + { MessageRemind = MessageRemindData, }; return Success(jsonData); @@ -105,12 +143,31 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { MessageRemindEntity entity = strEntity.ToObject(); - messageRindIBLL.SaveEntity(keyValue,entity); + messageRindIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } return Success("保存成功!"); } + + /// + /// 更改状态为已读 + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveReadSigns(string keyValue) + { + if (!string.IsNullOrEmpty(keyValue)) + { + messageRindIBLL.SaveReadSigns(keyValue); + } + return Success("保存成功!"); + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.cshtml index 7f3e857c6..176ce92ce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.cshtml @@ -19,9 +19,9 @@
发件人姓名
-
+
发送时间
- +
标题
@@ -29,7 +29,7 @@
内容
-
+
@Html.AppendJsFile("/Areas/LR_Desktop/Views/MessageRind/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.js new file mode 100644 index 000000000..4a30a5bfb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.js @@ -0,0 +1,41 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2021-05-08 + * 描 述:消息提醒 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LR_Desktop/MessageRemind/GetFormData?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + }); + } + } + }; + //保存数据 + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + $.lrSaveForm(top.$.rootUrl + '/LR_Desktop/MessageRind/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml index c89b38a02..a750e59dd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml @@ -16,9 +16,9 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js index e8a336cd1..38a843803 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js @@ -92,19 +92,25 @@ var bootstrap = function ($, learun) { $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); + }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetPageList', headData: [ - { label: "收件人ID", name: "ReceiptId", width: 100, align: "left"}, + //{ label: "收件人ID", name: "ReceiptId", width: 100, align: "left"}, { label: "收件人姓名", name: "ReceiptName", width: 100, align: "left"}, - { label: "发件人ID", name: "SenderId", width: 100, align: "left"}, + //{ label: "发件人ID", name: "SenderId", width: 100, align: "left"}, { label: "发件人姓名", name: "SenderName", width: 100, align: "left"}, { label: "发送时间", name: "SendTime", width: 100, align: "left"}, { label: "标题", name: "TheTitle", width: 100, align: "left"}, - { label: "内容", name: "TheContent", width: 100, align: "left"}, + { label: "内容", name: "TheContent", width: 400, align: "left" }, + { + label: "状态", name: "ReadSigns", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == false ? "未读" : "已读"; + } + }, ], mainId:'MessageId', isPage: true @@ -121,4 +127,26 @@ var bootstrap = function ($, learun) { $('#gridtable').jfGridSet('reload'); }; page.init(); + funopen(); + + function funopen() { + learun.layeropen({ + //id: 'form', + type: 2, + title: "消息提示", + closeBtn: 0, //不显示关闭按钮 + shade: [0], + area: ['340px', '215px'], + offset: 'rb', //右下角弹出 + anim: 2, + content: top.$.rootUrl + '/LR_Desktop/MessageRind/UnreadIndex', + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }; + + function onload() { + $('#gridtable').jfGridSet('reload'); + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml new file mode 100644 index 000000000..6119861ba --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml @@ -0,0 +1,143 @@ +@*@{ + ViewBag.Title = "未读消息"; + Layout = "~/Views/Shared/_Index.cshtml"; + } +
+
+
+ +
+
+
+
*@ + + + + + + 未读消息提醒 + + + + + @Html.AppendCssFile( + "/Views/LR_Content/style/lr-common.css", + "/Views/LR_Content/style/lr-iframe-index.css", + "~/Content/jquery/plugin/toastr/toastr.css" + ) + + + +
+ +
+ @Html.AppendJsFile( + "~/Content/jquery/plugin/toastr/toastr.min.js", + "~/Views/LR_Content/script/lr-admin.js", + "~/Views/LR_Content/script/lr-clientdata.js", + "~/Content/jquery/plugin/fullcalendar/js/jquery-1.7.2.min.js", + "~/Areas/LR_Desktop/Views/MessageRind/Index.js" + ) + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs index a9b7cca30..716624943 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs @@ -37,7 +37,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers private DataItemIBLL dataItemIbll = new DataItemBLL(); private DepartmentIBLL departmentIbll = new DepartmentBLL(); private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); - private DepartmentReleasePermissionsIBLL departmentReleasePermissionsIbll=new DepartmentReleasePermissionsBLL(); + private DepartmentReleasePermissionsIBLL departmentReleasePermissionsIbll = new DepartmentReleasePermissionsBLL(); + private MessageRindIBLL messageRindIBLL = new MessageRindBLL(); + #region 视图功能 /// /// 管理页面 @@ -277,7 +279,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers { var typeList = dataItemIbll.GetDetailList("NoticeCategory"); - var permissionsEntity= departmentReleasePermissionsIbll.GetTypesByUserId(userId); + var permissionsEntity = departmentReleasePermissionsIbll.GetTypesByUserId(userId); List list = new List(); if (permissionsEntity != null) @@ -316,7 +318,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01"); if (informationPushEntity != null && informationPushEntity.Status == true) { - //推送微信 + //推送微信和消息提醒表 Task.Run(async () => { await DoWeixinPush(entity); }); } if (entity.F_IsSendFX.HasValue && entity.F_IsSendFX == true) @@ -337,7 +339,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers Task DoWeixinPush(NewsEntity entity) { - //微信推送 + //微信推送、消息提醒表 try { var allteacherlist = userIbll.GetAllList().Where(m => @@ -409,6 +411,8 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers } } PushWeixin(needpostuserlist, entity.F_FullHead); + //消息提醒表 + PushMessageRemind(needpostuserlist, entity); return Task.CompletedTask; } catch (Exception e) @@ -434,7 +438,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers [AjaxOnly] public ActionResult RecycleForm(string keyValue) { - noticeIBLL.RecycleForm(keyValue,"-1"); + noticeIBLL.RecycleForm(keyValue, "-1"); return Success("操作成功!"); } [HttpPost] @@ -500,6 +504,31 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers } } } + + /// + /// 消息提醒 + /// + /// + /// + public void PushMessageRemind(List needpostuserlist, NewsEntity model) + { + foreach (UserEntity userinfo in needpostuserlist) + { + MessageRemindEntity entity = new MessageRemindEntity(); + entity.ReceiptId = userinfo.F_UserId; + entity.ReceiptName = userinfo.F_RealName; + entity.SenderId = model.F_CreateUserId; + entity.SenderName = model.F_CreateUserName; + entity.TheTitle = "通知公告"; + entity.TheContent = model.F_FullHead; + entity.InstanceId = model.F_NewsId; + entity.ConnectionUrl = "/Utility/ListContentIndex?id="; + entity.SendTime = DateTime.Now; + entity.ReadSigns = false; + messageRindIBLL.SaveEntity("", entity); + } + + } #endregion #region 流程 @@ -527,7 +556,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers public ActionResult GetFormDataByProcessId(string processId) { NewsEntity OANewsData = noticeIBLL.GetEntityByProcessId(processId); - OANewsData.F_NewsContent=WebHelper.HtmlDecode(OANewsData.F_NewsContent); + OANewsData.F_NewsContent = WebHelper.HtmlDecode(OANewsData.F_NewsContent); var jsonData = new { OANews = OANewsData, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 624b6cfde..63426a1f6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1253,6 +1253,7 @@ + @@ -7140,6 +7141,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-layer.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-layer.js index e50074863..c6f7a4b79 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-layer.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-layer.js @@ -212,6 +212,93 @@ } }); }, + + //页面弹窗 + layeropen: function (op) { + var dfop = { + id: null, + type: 2, + title: '系统窗口', + //url: 'error', + //btn: ['确认', '关闭'], + callBack: false, + maxmin: false, + end: false, + }; + $.extend(dfop, op || {}); + + /*适应窗口大小*/ + //dfop.width = dfop.width > $(window).width() ? $(window).width() - 10 : dfop.width; + //dfop.height = dfop.height > $(window).height() ? $(window).height() - 10 : dfop.height; + + var r = top.layer.open({ + id: dfop.id, + maxmin: dfop.maxmin, + type: 2, //0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层) + title: op.title, + area: ['350px', '240px'], + anim: 2, + btn: dfop.btn, + offset: 'rb', //右下角弹出 + closeBtn: 1, //显示关闭按钮 + shade: [0], + content: [op.content, 'yes'],//op.url, + //skin: dfop.btn == null ? 'lr-layer-nobtn' : 'lr-layer', + success: function (layero, index) { + top['layer_' + dfop.id] = learun.iframe($(layero).find('iframe').attr('id'), top.frames); + layero[0].learun_layerid = 'layer_' + dfop.id; + //如果底部有按钮添加-确认并关闭窗口勾选按钮 + if (!!dfop.btn && layero.find('.lr-layer-btn-cb').length == 0) { + top.learun.language.get('确认并关闭窗口', + function (text) { + layero.find('.layui-layer-btn') + .append('
'); + }); + layero.find('.layui-layer-btn a').each(function () { + var $this = $(this); + var _text = $this.text(); + top.learun.language.get(_text, + function (text) { + $this.text(text); + }); + + }); + } + layero.find('.layui-layer-title').each(function () { + var $this = $(this); + var _text = $this.text(); + top.learun.language.get(_text, + function (text) { + $this.text(text); + }); + + }); + }, + yes: function (index) { + var flag = true; + if (!!dfop.callBack) { + flag = dfop.callBack('layer_' + dfop.id); + } + if (dfop.id == 'formitem') { + learun.layerClose('', index); + } + if (!!flag) { + learun.layerClose('', index); + } + }, + end: function () { + top['layer_' + dfop.id] = null; + if (!!dfop.end) { + dfop.end(); + } + } + }); + }, + // 关闭弹层 layerClose: function (name, index) { var _index; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRemindEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRemindEntity.cs index 7ff669c4b..a1d98e964 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRemindEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRemindEntity.cs @@ -55,6 +55,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop [Column("CONNECTIONURL")] public string ConnectionUrl { get; set; } /// + /// 实例Id + /// + [Column("INSTANCEId")] + public string InstanceId { get; set; } + /// /// SendTime /// [Column("SENDTIME")] diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs index 463512507..233fc162d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs @@ -43,6 +43,29 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + /// + /// 未读消息 + /// + /// + public IEnumerable GetListForUnread() + { + try + { + return messageRindService.GetListForUnread(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取MessageRemind表实体数据 /// @@ -119,6 +142,28 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + /// + /// 修改为已读 + /// + /// + public void SaveReadSigns(string keyValue) + { + try + { + messageRindService.SaveReadSigns(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs index b1fcf6d57..bce83c965 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs @@ -22,6 +22,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// IEnumerable GetPageList(Pagination pagination, string queryJson); /// + /// 获取未读的消息 + /// + /// + IEnumerable GetListForUnread(); + /// /// 获取MessageRemind表实体数据 /// /// 主键 @@ -42,6 +47,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 主键 /// 实体 void SaveEntity(string keyValue, MessageRemindEntity entity); + /// + /// 修改为已读 + /// + /// + void SaveReadSigns(string keyValue); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs index 9e4788aa2..a68915eab 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs @@ -39,7 +39,8 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop t.SenderName, t.SendTime, t.TheTitle, - t.TheContent + t.TheContent, + t.ReadSigns "); strSql.Append(" FROM MessageRemind t "); strSql.Append(" WHERE 1=1 "); @@ -52,7 +53,30 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); strSql.Append(" AND ( t.SendTime >= @startTime AND t.SendTime <= @endTime ) "); } - return this.BaseRepository().FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取MessageRemind表未读的消息 + /// + /// + public IEnumerable GetListForUnread() + { + try + { + return this.BaseRepository().FindList(x => x.ReadSigns == false); } catch (Exception ex) { @@ -76,7 +100,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { - return this.BaseRepository().FindEntity(keyValue); + return this.BaseRepository().FindEntity(x => x.MessageId == keyValue); } catch (Exception ex) { @@ -103,7 +127,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { - this.BaseRepository().Delete(t=>t.MessageId == keyValue); + this.BaseRepository().Delete(t => t.MessageId == keyValue); } catch (Exception ex) { @@ -151,6 +175,31 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveReadSigns(string keyValue) + { + try + { + string sql = $"update MessageRemind set ReadSigns=1 where MessageId='{keyValue}'"; + this.BaseRepository().ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion }