@@ -0,0 +1,187 @@ | |||||
using Learun.Util; | |||||
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 | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-04-23 16:58 | |||||
/// 描 述:消息提醒 | |||||
/// </summary> | |||||
public class MessageRindController : MvcControllerBase | |||||
{ | |||||
private MessageRindIBLL messageRindIBLL = new MessageRindBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 未读消息页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult UnreadIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = messageRindIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取未读的消息的数量 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetCountForUnread() | |||||
{ | |||||
var count = messageRindIBLL.GetCountForUnread(); | |||||
return Success(count); | |||||
} | |||||
/// <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> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var MessageRemindData = messageRindIBLL.GetMessageRemindEntity(keyValue); | |||||
var jsonData = new | |||||
{ | |||||
MessageRemind = MessageRemindData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
messageRindIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="strEntity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, string strEntity) | |||||
{ | |||||
MessageRemindEntity entity = strEntity.ToObject<MessageRemindEntity>(); | |||||
messageRindIBLL.SaveEntity(keyValue, entity); | |||||
if (string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
} | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 更改状态为已读 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="strEntity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SaveReadSigns(string keyValue) | |||||
{ | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
messageRindIBLL.SaveReadSigns(keyValue); | |||||
} | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,35 @@ | |||||
@{ | |||||
ViewBag.Title = "消息提醒"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-6 lr-form-item" data-table="MessageRemind" > | |||||
<div class="lr-form-item-title">收件人ID</div> | |||||
<input id="ReceiptId" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="MessageRemind" > | |||||
<div class="lr-form-item-title">收件人姓名</div> | |||||
<input id="ReceiptName" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="MessageRemind" > | |||||
<div class="lr-form-item-title">发件人ID</div> | |||||
<input id="SenderId" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="MessageRemind" > | |||||
<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="lr-form-item-title">发送时间</div> | |||||
<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> | |||||
<input id="TheTitle" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="MessageRemind" > | |||||
<div class="lr-form-item-title">内容</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(); | |||||
} |
@@ -0,0 +1,90 @@ | |||||
@{ | |||||
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-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<div id="datesearch"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<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_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_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||||
</div> | |||||
<div class="layui-btn-container"> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
<div id="winpop"> | |||||
<div class="title">您有新的未读消息<span class="close" onclick="tips_pop()">x</span></div> | |||||
<div id="notifications"> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/MessageRind/Index.js"); | |||||
<script> | |||||
function tips_pop() { | |||||
var MsgPop = document.getElementById("winpop"); | |||||
var popH = parseInt(MsgPop.style.height); | |||||
if (popH == 0) { | |||||
MsgPop.style.Height = "block"; | |||||
show = setInterval("changeH('up')", 2); | |||||
} else { | |||||
hide = setInterval("changeH('down')", 2); | |||||
} | |||||
} | |||||
function changeH(str) { | |||||
var magPop = document.getElementById("winpop"); | |||||
var popH = parseInt(MsgPop.style.Height); | |||||
if (str == "up") { | |||||
if (popH <= 100) { | |||||
msgPop.style.height = (popH + 4).toString() + "px"; | |||||
} else { | |||||
clearInterval(show); | |||||
} | |||||
} | |||||
if (str == "down") { | |||||
if (popH >= 4) { | |||||
MsgPop.style.Height = (popH - 4).toString() + "px"; | |||||
} else { | |||||
clearInterval(hide); | |||||
MsgPop.style.display = "none"; | |||||
} | |||||
} | |||||
window.onload = function() { | |||||
document.getElementById('winpop').style.height = '0px'; | |||||
setTimeout("tips_pop()", 800); | |||||
} | |||||
} | |||||
function Winpop() { | |||||
var state = '0'; | |||||
$.get(${ ctx } / sys / msGetUserMedia / getMsgList ? state + "&t=" + new Date().getTime(),function(data) { | |||||
$("#notifications").html(data); | |||||
}), | |||||
} | |||||
winpop(); | |||||
setInterval(function() { | |||||
$("#winpop").load(Winpop(), ""); | |||||
}, | |||||
1000); | |||||
</script> |
@@ -0,0 +1,133 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2021-04-23 16:58 | |||||
* 描 述:消息提醒 | |||||
*/ | |||||
var refreshGirdData; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var startTime; | |||||
var endTime; | |||||
var page = { | |||||
init: function () { | |||||
page.initGird(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 时间搜索框 | |||||
$('#datesearch').lrdate({ | |||||
dfdata: [ | |||||
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||||
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||||
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||||
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } | |||||
], | |||||
// 月 | |||||
mShow: false, | |||||
premShow: false, | |||||
// 季度 | |||||
jShow: false, | |||||
prejShow: false, | |||||
// 年 | |||||
ysShow: false, | |||||
yxShow: false, | |||||
preyShow: false, | |||||
yShow: false, | |||||
// 默认 | |||||
dfvalue: '1', | |||||
selectfn: function (begin, end) { | |||||
startTime = begin; | |||||
endTime = end; | |||||
page.search(); | |||||
} | |||||
}); | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '新增', | |||||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/Form', | |||||
width: 600, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('MessageId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/Form?keyValue=' + keyValue, | |||||
width: 600, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('MessageId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_Desktop/MessageRind/DeleteForm', { keyValue: keyValue}, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 打印 | |||||
$('#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: "收件人姓名", name: "ReceiptName", 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: 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 | |||||
}); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
param.StartTime = startTime; | |||||
param.EndTime = endTime; | |||||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||||
} | |||||
}; | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,140 @@ | |||||
@*@{ | |||||
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) { | |||||
console.log(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) { | |||||
//弹窗查看详情 | |||||
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, | |||||
}); | |||||
} | |||||
} | |||||
}) | |||||
} | |||||
}); | |||||
}); | |||||
//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> |
@@ -34,7 +34,7 @@ var bootstrap = function ($, learun) { | |||||
type: 'multiple', | type: 'multiple', | ||||
value: "id", | value: "id", | ||||
text: "text", | text: "text", | ||||
data: [{ id: '1', text: '邮件' }, { id: '2', text: '微信' }, { id: '3', text: '短信' }, { id: '4', text: '系统IM' }, { id: '5', text: '飞星' }]//1邮箱2微信3短信4系统IM | |||||
data: [{ id: '1', text: '邮件' }, { id: '2', text: '微信' }, { id: '3', text: '短信' }, { id: '4', text: '系统IM' }, { id: '5', text: '飞星' }, { id: '6', text: '站内消息' }]//1邮箱2微信3短信4系统IM | |||||
}); | }); | ||||
$('#F_StrategyCode').on('blur', function () { | $('#F_StrategyCode').on('blur', function () { | ||||
@@ -390,6 +390,7 @@ | |||||
<Compile Include="Areas\LR_Desktop\Controllers\DTListController.cs" /> | <Compile Include="Areas\LR_Desktop\Controllers\DTListController.cs" /> | ||||
<Compile Include="Areas\LR_Desktop\Controllers\DTSettingController.cs" /> | <Compile Include="Areas\LR_Desktop\Controllers\DTSettingController.cs" /> | ||||
<Compile Include="Areas\LR_Desktop\Controllers\DTTargetController.cs" /> | <Compile Include="Areas\LR_Desktop\Controllers\DTTargetController.cs" /> | ||||
<Compile Include="Areas\LR_Desktop\Controllers\MessageRindController.cs" /> | |||||
<Compile Include="Areas\LR_Desktop\Controllers\WeChatDevelopController.cs" /> | <Compile Include="Areas\LR_Desktop\Controllers\WeChatDevelopController.cs" /> | ||||
<Compile Include="Areas\LR_Desktop\LR_DesktopAreaRegistration.cs" /> | <Compile Include="Areas\LR_Desktop\LR_DesktopAreaRegistration.cs" /> | ||||
<Compile Include="Areas\LR_DisplayBoard\Controllers\LR_KBConfigInfoController.cs" /> | <Compile Include="Areas\LR_DisplayBoard\Controllers\LR_KBConfigInfoController.cs" /> | ||||
@@ -1249,6 +1250,8 @@ | |||||
<Content Include="Areas\LR_Desktop\Views\DTSetting\App\AppIndex.js" /> | <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.css" /> | ||||
<Content Include="Areas\LR_Desktop\Views\DTSetting\PC\PcIndex.js" /> | <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\MessageRind\Index.js" /> | |||||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Form.js" /> | <Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Form.js" /> | ||||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Index.js" /> | <Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Index.js" /> | ||||
<Content Include="Areas\LR_DisplayBoard\Views\LR_KBConfigInfo\ChartForm.css" /> | <Content Include="Areas\LR_DisplayBoard\Views\LR_KBConfigInfo\ChartForm.css" /> | ||||
@@ -7115,6 +7118,9 @@ | |||||
<Content Include="Areas\Ask\Views\Ask_MainOfTeacher\PaperAdminView.cshtml" /> | <Content Include="Areas\Ask\Views\Ask_MainOfTeacher\PaperAdminView.cshtml" /> | ||||
<Content Include="Areas\Ask\Views\Ask_MainOfTeacher\PaperView.cshtml" /> | <Content Include="Areas\Ask\Views\Ask_MainOfTeacher\PaperView.cshtml" /> | ||||
<Content Include="Areas\Ask\Views\Ask_MainOfTeacher\TeacherIndex.cshtml" /> | <Content Include="Areas\Ask\Views\Ask_MainOfTeacher\TeacherIndex.cshtml" /> | ||||
<Content Include="Areas\LR_Desktop\Views\MessageRind\Form.cshtml" /> | |||||
<Content Include="Areas\LR_Desktop\Views\MessageRind\Index.cshtml" /> | |||||
<Content Include="Areas\LR_Desktop\Views\MessageRind\UnreadIndex.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | ||||
@@ -21,9 +21,10 @@ | |||||
<div id="TitleColor" class="portal-panel-title"> | <div id="TitleColor" class="portal-panel-title"> | ||||
<i class="fa fa-balance-scale"></i> 统计指标 | <i class="fa fa-balance-scale"></i> 统计指标 | ||||
</div> | </div> | ||||
<div class="portal-panel-content" id="lr_target" > | |||||
<div class="portal-panel-content" id="lr_target"> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<audio id="sound" autoplay="autoplay"></audio> | |||||
</div> | </div> | ||||
@@ -269,5 +269,39 @@ | |||||
c(g.list || []); | c(g.list || []); | ||||
a(g.chart || []) | a(g.chart || []) | ||||
} | } | ||||
}) | |||||
}) | |||||
funopen(); | |||||
window.setInterval(funopen, 60000); | |||||
//window.clearInterval(t1); | |||||
//消息提醒 | |||||
function funopen() { | |||||
$.ajax({ | |||||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetCountForUnread', | |||||
type: "get", | |||||
dataType: "json", | |||||
async: false, | |||||
success: function (data) { | |||||
console.log(data); | |||||
if (data.data> 0) { | |||||
document.getElementById("sound").src = '/Resource/wav/收到新消息.wav'; | |||||
top.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); | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}; | |||||
}); | }); |
@@ -212,6 +212,94 @@ | |||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
//页面弹窗 | |||||
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: false,//[0], | |||||
time: 60000, //60秒后自动关闭 | |||||
content: op.content,//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) { | layerClose: function (name, index) { | ||||
var _index; | var _index; | ||||
@@ -0,0 +1,29 @@ | |||||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||||
using System.Data.Entity.ModelConfiguration; | |||||
namespace Learun.Application.Mapping | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2018-09-25 11:32 | |||||
/// 描 述:消息提醒 | |||||
/// </summary> | |||||
public class MessageRemindMap : EntityTypeConfiguration<MessageRemindEntity> | |||||
{ | |||||
public MessageRemindMap() | |||||
{ | |||||
#region 表、主键 | |||||
//表 | |||||
this.ToTable("MESSAGEREMIND"); | |||||
//主键 | |||||
this.HasKey(t => t.MessageId); | |||||
#endregion | |||||
#region 配置关系 | |||||
#endregion | |||||
} | |||||
} | |||||
} | |||||
@@ -112,6 +112,7 @@ | |||||
<Compile Include="LR_CodeDemo\LR_OA_ProjectMap.cs" /> | <Compile Include="LR_CodeDemo\LR_OA_ProjectMap.cs" /> | ||||
<Compile Include="LR_CRM\CrmCustomerContactMap.cs" /> | <Compile Include="LR_CRM\CrmCustomerContactMap.cs" /> | ||||
<Compile Include="LR_CRM\CrmChanceMap.cs" /> | <Compile Include="LR_CRM\CrmChanceMap.cs" /> | ||||
<Compile Include="LR_Desktop\MessageRemindMap.cs" /> | |||||
<Compile Include="LR_Desktop\WeChatDevelopMap.cs" /> | <Compile Include="LR_Desktop\WeChatDevelopMap.cs" /> | ||||
<Compile Include="LR_Excel\ExcelExportMap.cs" /> | <Compile Include="LR_Excel\ExcelExportMap.cs" /> | ||||
<Compile Include="LR_Excel\ExcelImportFieldMap.cs" /> | <Compile Include="LR_Excel\ExcelImportFieldMap.cs" /> | ||||
@@ -472,6 +472,32 @@ namespace Learun.Application.Message | |||||
{ | { | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 消息提醒 | |||||
/// </summary> | |||||
/// <param name="needpostuserlist"></param> | |||||
/// <param name="title"></param> | |||||
public void PushMessageRemind(List<UserEntity> needpostuserlist, string content, NWFTaskMsgEntity model) | |||||
{ | |||||
foreach (UserEntity userinfo in needpostuserlist) | |||||
{ | |||||
MessageRemindEntity entity = new MessageRemindEntity(); | |||||
entity.ReceiptId = userinfo.F_UserId; | |||||
entity.ReceiptName = userinfo.F_RealName; | |||||
entity.SenderId = model.F_ToUserId; | |||||
entity.SenderName = model.F_ToName; | |||||
entity.TheTitle = "流程通知"; | |||||
entity.TheContent = model.F_Title + ":" + content; | |||||
entity.InstanceId = model.F_Id; | |||||
entity.ConnectionUrl = "/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId="; | |||||
entity.SendTime = DateTime.Now; | |||||
entity.ReadSigns = false; | |||||
//messageRindIBLL.SaveEntity("", entity); | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 微信发送(企业号) | /// 微信发送(企业号) | ||||
/// </summary> | /// </summary> | ||||
@@ -0,0 +1,95 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.ComponentModel.DataAnnotations.Schema; | |||||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-04-23 16:58 | |||||
/// 描 述:消息提醒 | |||||
/// </summary> | |||||
public class MessageRemindEntity | |||||
{ | |||||
#region 实体成员 | |||||
/// <summary> | |||||
/// MessageId | |||||
/// </summary> | |||||
[Column("MESSAGEID")] | |||||
public string MessageId { get; set; } | |||||
/// <summary> | |||||
/// ReceiptId | |||||
/// </summary> | |||||
[Column("RECEIPTID")] | |||||
public string ReceiptId { get; set; } | |||||
/// <summary> | |||||
/// ReceiptName | |||||
/// </summary> | |||||
[Column("RECEIPTNAME")] | |||||
public string ReceiptName { get; set; } | |||||
/// <summary> | |||||
/// SenderId | |||||
/// </summary> | |||||
[Column("SENDERID")] | |||||
public string SenderId { get; set; } | |||||
/// <summary> | |||||
/// SenderName | |||||
/// </summary> | |||||
[Column("SENDERNAME")] | |||||
public string SenderName { get; set; } | |||||
/// <summary> | |||||
/// TheTitle | |||||
/// </summary> | |||||
[Column("THETITLE")] | |||||
public string TheTitle { get; set; } | |||||
/// <summary> | |||||
/// TheContent | |||||
/// </summary> | |||||
[Column("THECONTENT")] | |||||
public string TheContent { get; set; } | |||||
/// <summary> | |||||
/// ConnectionUrl | |||||
/// </summary> | |||||
[Column("CONNECTIONURL")] | |||||
public string ConnectionUrl { get; set; } | |||||
/// <summary> | |||||
/// 实例Id | |||||
/// </summary> | |||||
[Column("INSTANCEId")] | |||||
public string InstanceId { get; set; } | |||||
/// <summary> | |||||
/// SendTime | |||||
/// </summary> | |||||
[Column("SENDTIME")] | |||||
public DateTime? SendTime { get; set; } | |||||
/// <summary> | |||||
/// ReadSigns | |||||
/// </summary> | |||||
[Column("READSIGNS")] | |||||
public bool? ReadSigns { get; set; } | |||||
#endregion | |||||
#region 扩展操作 | |||||
/// <summary> | |||||
/// 新增调用 | |||||
/// </summary> | |||||
public void Create() | |||||
{ | |||||
this.MessageId = Guid.NewGuid().ToString(); | |||||
} | |||||
/// <summary> | |||||
/// 编辑调用 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void Modify(string keyValue) | |||||
{ | |||||
this.MessageId = keyValue; | |||||
} | |||||
#endregion | |||||
#region 扩展字段 | |||||
#endregion | |||||
} | |||||
} | |||||
@@ -0,0 +1,194 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-04-23 16:58 | |||||
/// 描 述:消息提醒 | |||||
/// </summary> | |||||
public class MessageRindBLL : MessageRindIBLL | |||||
{ | |||||
private MessageRindService messageRindService = new MessageRindService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<MessageRemindEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return messageRindService.GetPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <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> | |||||
/// 未读消息的数量 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public int GetCountForUnread() | |||||
{ | |||||
try | |||||
{ | |||||
return messageRindService.GetCountForUnread(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取MessageRemind表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public MessageRemindEntity GetMessageRemindEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return messageRindService.GetMessageRemindEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
messageRindService.DeleteEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
public void SaveEntity(string keyValue, MessageRemindEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
messageRindService.SaveEntity(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <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 | |||||
} | |||||
} |
@@ -0,0 +1,63 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-04-23 16:58 | |||||
/// 描 述:消息提醒 | |||||
/// </summary> | |||||
public interface MessageRindIBLL | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<MessageRemindEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取未读的消息 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
IEnumerable<MessageRemindEntity> GetListForUnread(); | |||||
/// <summary> | |||||
/// 获取未读的消息的数量 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
int GetCountForUnread(); | |||||
/// <summary> | |||||
/// 获取MessageRemind表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
MessageRemindEntity GetMessageRemindEntity(string keyValue); | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
void DeleteEntity(string keyValue); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <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 | |||||
} | |||||
} |
@@ -0,0 +1,234 @@ | |||||
using Dapper; | |||||
using Learun.DataBase.Repository; | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Data; | |||||
using System.Text; | |||||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-04-23 16:58 | |||||
/// 描 述:消息提醒 | |||||
/// </summary> | |||||
public class MessageRindService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<MessageRemindEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" | |||||
t.MessageId, | |||||
t.ReceiptId, | |||||
t.ReceiptName, | |||||
t.SenderId, | |||||
t.SenderName, | |||||
t.SendTime, | |||||
t.TheTitle, | |||||
t.TheContent, | |||||
t.ReadSigns | |||||
"); | |||||
strSql.Append(" FROM MessageRemind t "); | |||||
strSql.Append(" WHERE 1=1 "); | |||||
var queryParam = queryJson.ToJObject(); | |||||
// 虚拟参数 | |||||
var dp = new DynamicParameters(new { }); | |||||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||||
{ | |||||
dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); | |||||
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); | |||||
} | |||||
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) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取MessageRemind表未读消息的数量 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public int GetCountForUnread() | |||||
{ | |||||
try | |||||
{ | |||||
string sql = "select count(1) from MessageRemind where ReadSigns=0"; | |||||
var obj = this.BaseRepository().FindObject(sql); | |||||
if (obj == null) | |||||
return 0; | |||||
else | |||||
return Convert.ToInt32(obj); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取MessageRemind表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public MessageRemindEntity GetMessageRemindEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository().FindEntity<MessageRemindEntity>(x => x.MessageId == keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
this.BaseRepository().Delete<MessageRemindEntity>(t => t.MessageId == keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
public void SaveEntity(string keyValue, MessageRemindEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
entity.Modify(keyValue); | |||||
this.BaseRepository().Update(entity); | |||||
} | |||||
else | |||||
{ | |||||
entity.Create(); | |||||
this.BaseRepository().Insert(entity); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <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 | |||||
} | |||||
} |
@@ -261,6 +261,10 @@ | |||||
<Compile Include="LR_CodeDemo\WorkOrder\WorkOrderBLL.cs" /> | <Compile Include="LR_CodeDemo\WorkOrder\WorkOrderBLL.cs" /> | ||||
<Compile Include="LR_CodeDemo\WorkOrder\WorkOrderIBLL.cs" /> | <Compile Include="LR_CodeDemo\WorkOrder\WorkOrderIBLL.cs" /> | ||||
<Compile Include="LR_CodeDemo\WorkOrder\WorkOrderService.cs" /> | <Compile Include="LR_CodeDemo\WorkOrder\WorkOrderService.cs" /> | ||||
<Compile Include="LR_Desktop\MessageRind\MessageRemindEntity.cs" /> | |||||
<Compile Include="LR_Desktop\MessageRind\MessageRindBLL.cs" /> | |||||
<Compile Include="LR_Desktop\MessageRind\MessageRindIBLL.cs" /> | |||||
<Compile Include="LR_Desktop\MessageRind\MessageRindService.cs" /> | |||||
<Compile Include="LR_Desktop\WeChatDevelop\WeChatDevelopBLL.cs" /> | <Compile Include="LR_Desktop\WeChatDevelop\WeChatDevelopBLL.cs" /> | ||||
<Compile Include="LR_Desktop\WeChatDevelop\WeChatDevelopEntity.cs" /> | <Compile Include="LR_Desktop\WeChatDevelop\WeChatDevelopEntity.cs" /> | ||||
<Compile Include="LR_Desktop\WeChatDevelop\WeChatDevelopIBLL.cs" /> | <Compile Include="LR_Desktop\WeChatDevelop\WeChatDevelopIBLL.cs" /> | ||||