@@ -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(); | |||
} | |||
/// <summary> | |||
/// 未读消息页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult UnreadIndex() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -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); | |||
} | |||
/// <summary> | |||
/// 获取未读的消息 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetListForUnread() | |||
{ | |||
var data = messageRindIBLL.GetListForUnread(); | |||
List<Hashtable> list = new List<Hashtable>(); | |||
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); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
@@ -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<MessageRemindEntity>(); | |||
messageRindIBLL.SaveEntity(keyValue,entity); | |||
messageRindIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 更改状态为已读 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveReadSigns(string keyValue) | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
messageRindIBLL.SaveReadSigns(keyValue); | |||
} | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
@@ -19,9 +19,9 @@ | |||
<div class="lr-form-item-title">发件人姓名</div> | |||
<input id="SenderName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="MessageRemind" > | |||
<div class="col-xs-6 lr-form-item" data-table="MessageRemind"> | |||
<div class="lr-form-item-title">发送时间</div> | |||
<input id="SendTime" type="text" class="form-control" /> | |||
<input id="SendTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#SendTime').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="MessageRemind" > | |||
<div class="lr-form-item-title">标题</div> | |||
@@ -29,7 +29,7 @@ | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="MessageRemind" > | |||
<div class="lr-form-item-title">内容</div> | |||
<div id="TheContent" style="height:200px;"></div> | |||
<textarea id="TheContent" style="height:100px;width:100%"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/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(); | |||
} |
@@ -16,9 +16,9 @@ | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
@*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a>*@ | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
@@ -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 ? "<span class=\"label label-danger\">未读</span>" : "<span class=\"label label-success\">已读</span>"; | |||
} | |||
}, | |||
], | |||
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'); | |||
} | |||
} |
@@ -0,0 +1,143 @@ | |||
@*@{ | |||
ViewBag.Title = "未读消息"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-body" id="content"></div> | |||
</div> | |||
</div> | |||
</div>*@ | |||
<!DOCTYPE html> | |||
<html> | |||
<head> | |||
<meta name="viewport" content="width=device-width" /> | |||
<title>未读消息提醒</title> | |||
<script src="~/Content/jquery/plugin/fullcalendar/js/jquery-1.7.2.min.js"></script> | |||
<script src="~/Content/jquery/plugin/jquery-ui/jquery-ui.min.js"></script> | |||
<script src="~/Content/jquery/plugin/fullcalendar/js/fullcalendar.min.js"></script> | |||
<link href="~/Content/jquery/plugin/fullcalendar/css/fullcalendar.css" rel="stylesheet" /> | |||
@Html.AppendCssFile( | |||
"/Views/LR_Content/style/lr-common.css", | |||
"/Views/LR_Content/style/lr-iframe-index.css", | |||
"~/Content/jquery/plugin/toastr/toastr.css" | |||
) | |||
</head> | |||
<body> | |||
<div id='content'> | |||
</div> | |||
@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" | |||
) | |||
<script type='text/javascript'> | |||
$(document).ready(function () { | |||
getdata(); | |||
function getdata() { | |||
$.ajax({ | |||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetListForUnread', | |||
type: "get", | |||
dataType: "json", | |||
async: false, | |||
success: function (data) { | |||
var content = ""; | |||
if (data.length > 0) { | |||
content += "<ul id='uldata'>"; | |||
for (var i = 0; i < data.length; i++) { | |||
content += "<li>" + " " + data[i]["SenderName"] + "的消息:" + "</li>"; | |||
var theContent = data[i]["TheContent"]; | |||
//可显示的最长长度 | |||
var maxlen = 50; | |||
if (theContent.length > maxlen) { | |||
theContent = theContent.substring(0, maxlen - 3) + "..."; | |||
} | |||
var param = data[i]["TheTitle"] + "、" + data[i]["InstanceId"] + "、" + data[i]["MessageId"] + "、" + data[i]["ConnectionUrl"]; | |||
content += "<li>"; | |||
content += " 【" + data[i]["TheTitle"] + "】" + theContent + " "; | |||
content += '<a id="' + param + '" href="javascript:void(0);" class="lr-item" style="color:blue;textDecoration:underline">点击查看>>'; | |||
content += "</a>"; | |||
content += "</li>"; | |||
} | |||
content += "</ul>"; | |||
} | |||
else { | |||
content = "暂无未读消息"; | |||
} | |||
$("#content").html(content); | |||
} | |||
}); | |||
} | |||
$('#uldata .lr-item').on('click', function () { | |||
var $obj = $(this); | |||
var params = ($obj.attr('id')).split('、'); | |||
//更改状态为已读 | |||
var MessageId = params[2]; | |||
if (top.learun.checkrow(MessageId)) { | |||
$.ajax({ | |||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/SaveReadSigns', | |||
type: "post", | |||
data: { keyValue: MessageId }, | |||
dataType: "json", | |||
async: false, | |||
success: function (data) { | |||
//console.log(data); | |||
//弹窗查看详情 | |||
var keyValue = params[1]; | |||
var ConnectionUrl = params[3]; | |||
var title = params[0]; | |||
if (top.learun.checkrow(keyValue)) { | |||
top.learun.layerForm({ | |||
id: 'formview', | |||
title: title, | |||
url: top.$.rootUrl + ConnectionUrl + keyValue, | |||
width: 1000, | |||
height: 650, | |||
maxmin: true, | |||
btn: null, | |||
callBack: function (id) { | |||
return top[id].acceptClick(onload()); | |||
} | |||
}); | |||
} | |||
} | |||
}) | |||
} | |||
}); | |||
}); | |||
//function funLook(param) { | |||
// var id = "433d5658-40b0-4e2d-b736-c4e8561d017e";//$obj.attr('id'); | |||
// var _module = top.learun.clientdata.get(['modulesMap', id]); | |||
// switch (_module.F_Target) { | |||
// case 'iframe':// 窗口 | |||
// if (top.learun.validator.isNotNull(_module.F_UrlAddress).code) { | |||
// top.learun.frameTab.open(_module); | |||
// } | |||
// break; | |||
// case 'open':// 窗口 | |||
// var newWin = window.open(_module.F_UrlAddress); | |||
// newWin.location.replace(_module.F_UrlAddress); | |||
// break; | |||
// } | |||
//} | |||
</script> | |||
</body> | |||
</html> |
@@ -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 视图功能 | |||
/// <summary> | |||
/// 管理页面 | |||
@@ -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<object> list = new List<object>(); | |||
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 | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 消息提醒 | |||
/// </summary> | |||
/// <param name="needpostuserlist"></param> | |||
/// <param name="title"></param> | |||
public void PushMessageRemind(List<UserEntity> 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, | |||
@@ -1253,6 +1253,7 @@ | |||
<Content Include="Areas\LR_Desktop\Views\DTSetting\App\AppIndex.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\DTSetting\PC\PcIndex.css" /> | |||
<Content Include="Areas\LR_Desktop\Views\DTSetting\PC\PcIndex.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\MessageRind\Form.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Form.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Index.js" /> | |||
<Content Include="Areas\LR_DisplayBoard\Views\LR_KBConfigInfo\ChartForm.css" /> | |||
@@ -7140,6 +7141,7 @@ | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\ContractFilingMonitor.cshtml" /> | |||
<Content Include="Areas\Permission\Views\Perm_FunctionVisit\IndexForCount.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\SchoolCalendar\ScheduleIndex.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\MessageRind\UnreadIndex.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -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('<div class="checkbox lr-layer-btn-cb" myIframeId="layer_' + | |||
dfop.id + | |||
'" ><label><input checked="checked" type="checkbox" >' + | |||
text + | |||
'</label></div>'); | |||
}); | |||
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; | |||
@@ -55,6 +55,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
[Column("CONNECTIONURL")] | |||
public string ConnectionUrl { get; set; } | |||
/// <summary> | |||
/// 实例Id | |||
/// </summary> | |||
[Column("INSTANCEId")] | |||
public string InstanceId { get; set; } | |||
/// <summary> | |||
/// SendTime | |||
/// </summary> | |||
[Column("SENDTIME")] | |||
@@ -43,6 +43,29 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
/// <summary> | |||
/// 未读消息 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<MessageRemindEntity> GetListForUnread() | |||
{ | |||
try | |||
{ | |||
return messageRindService.GetListForUnread(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取MessageRemind表实体数据 | |||
/// </summary> | |||
@@ -119,6 +142,28 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
/// <summary> | |||
/// 修改为已读 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void SaveReadSigns(string keyValue) | |||
{ | |||
try | |||
{ | |||
messageRindService.SaveReadSigns(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -22,6 +22,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// <returns></returns> | |||
IEnumerable<MessageRemindEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取未读的消息 | |||
/// </summary> | |||
/// <returns></returns> | |||
IEnumerable<MessageRemindEntity> GetListForUnread(); | |||
/// <summary> | |||
/// 获取MessageRemind表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
@@ -42,6 +47,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, MessageRemindEntity entity); | |||
/// <summary> | |||
/// 修改为已读 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
void SaveReadSigns(string keyValue); | |||
#endregion | |||
} | |||
@@ -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<MessageRemindEntity>(strSql.ToString(),dp, pagination); | |||
return this.BaseRepository().FindList<MessageRemindEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取MessageRemind表未读的消息 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<MessageRemindEntity> GetListForUnread() | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindList<MessageRemindEntity>(x => x.ReadSigns == false); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -76,7 +100,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<MessageRemindEntity>(keyValue); | |||
return this.BaseRepository().FindEntity<MessageRemindEntity>(x => x.MessageId == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -103,7 +127,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
try | |||
{ | |||
this.BaseRepository().Delete<MessageRemindEntity>(t=>t.MessageId == keyValue); | |||
this.BaseRepository().Delete<MessageRemindEntity>(t => t.MessageId == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -151,6 +175,31 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
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 | |||
} | |||