Преглед изворни кода

公文功能与金隅同步

西昌缴费二期
liangkun пре 3 година
родитељ
комит
32c74907a1
17 измењених фајлова са 1469 додато и 6 уклоњено
  1. +50
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveDocumentController.cs
  2. +72
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveFileController.cs
  3. +75
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_SendFileController.cs
  4. +188
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs
  5. +35
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.cshtml
  6. +41
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.js
  7. +94
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml
  8. +150
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js
  9. +141
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml
  10. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  11. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/MessageRemindMap.cs
  12. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
  13. +95
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRemindEntity.cs
  14. +194
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs
  15. +63
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs
  16. +231
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs
  17. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj

+ 50
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveDocumentController.cs Прегледај датотеку

@@ -3,6 +3,7 @@ using System.Data;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Web.Mvc;
using System.Collections.Generic;
using System.Linq;

namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
@@ -16,6 +17,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
public class SYS_ReceiveDocumentController : MvcControllerBase
{
private SYS_ReceiveDocumentIBLL sYS_ReceiveDocumentIBLL = new SYS_ReceiveDocumentBLL();
private Sys_ReceiveFileIBLL receiveFileIbll=new Sys_ReceiveFileBLL();

#region 视图功能

@@ -28,6 +30,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 公文接收归档
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult IndexFile()
{
return View();
}
/// <summary>
/// 表单页
/// <summary>
@@ -56,17 +69,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 阅读详情
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult SelectUserForm()
public ActionResult ReadList()
{
return View();
}
/// <summary>
/// 阅读详情
/// 打印页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult ReadList()
public ActionResult PrintView()
{
return View();
}
@@ -85,6 +103,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = sYS_ReceiveDocumentIBLL.GetPageList(paginationobj, queryJson);

foreach (var item in data)
{
var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.RID}'";
var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.RID}'";
var readdt = sYS_ReceiveDocumentIBLL.Execute(sql);
var senddt = sYS_ReceiveDocumentIBLL.Execute(sendSql);
var readcount = readdt.Rows[0][0];
var sendcount = senddt.Rows[0][0];
item.NumberPeople = $"{readcount}/{sendcount}";
}
var jsonData = new
{
rows = data,
@@ -124,6 +153,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}



public ActionResult PrintInfo(string keyValue)
{
var entity = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
var entityItem = receiveFileIbll.GetPageListBySendId(keyValue).ToList().Where(a=>a.ReadTime!=null).OrderBy(a=>a.ReadTime);
object data = new
{
entity,
entityItem
};

return Success(data);
}
#endregion

#region 提交数据
@@ -157,6 +201,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
}
return Success("操作成功!");
}



/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>


+ 72
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveFileController.cs Прегледај датотеку

@@ -120,6 +120,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return Success(jsonData);
}
/// <summary>
/// 获取批示信息
/// <summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetInstructions(string keyValue)
{
var data = sys_ReceiveFileIBLL.GetInstructions(keyValue);
var jsonData = new
{
rows = data,
};
return Success(jsonData);
}
/// <summary>
/// 获取页面显示列表数据
/// <summary>
/// <param name="queryJson">查询参数</param>
@@ -185,6 +201,30 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return Success("删除成功!");
}
/// <summary>
/// 设置批示状态为已处理
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult DisPose(string keyValue)
{
sys_ReceiveFileIBLL.DisPose(keyValue);
return Success("操作成功!");
}
/// <summary>
/// 重置
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult Reset(string keyValue)
{
sys_ReceiveFileIBLL.Reset(keyValue);
return Success("操作成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
@@ -230,6 +270,38 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
return Success("保存成功!");
}

/// <summary>
/// 主任批示
/// </summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult ZhuRenP(string strEntity)
{
Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
entity.SpecifyReceiver = sys_ReceiveFileIBLL.ZhuRenP();
//entity.SpecifyReceiver = "System";
sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
return Success("发送成功");
}

/// <summary>
/// 校长批示
/// </summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult XiaoZhangP(string strEntity)
{
Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
entity.SpecifyReceiver = sys_ReceiveFileIBLL.XiaoZhangP();
//entity.SpecifyReceiver = "System";
sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
return Success("发送成功");
}


/// <summary>
/// 查看实体数据
/// <param name="keyValue">主键</param>


+ 75
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_SendFileController.cs Прегледај датотеку

@@ -21,7 +21,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
private Sys_SendFileIBLL sys_SendFileIBLL = new Sys_SendFileBLL();

#region 视图功能
#region 视图功能

/// <summary>
/// 主页面
@@ -32,6 +32,26 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 行政公文归档
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult IndexFile()
{
return View();
}

/// <summary>
/// 党政公文归档
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult IndexPartyFile()
{
return View();
}
[HttpGet]
public ActionResult IndexDocument()
{
@@ -47,6 +67,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 主页面【党政公文下发】
/// <summary>
@@ -56,11 +77,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

[HttpGet]
public ActionResult FormDocument()
{
return View();
}

/// <summary>
/// 表单页
/// <summary>
@@ -70,6 +93,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 表单页【党政公文下发】
/// <summary>
@@ -91,6 +115,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 【党政公文下发】
/// </summary>
@@ -100,6 +125,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

[HttpGet]
public ActionResult ReadList()
{
@@ -111,6 +137,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 【党政公文下发】
/// </summary>
@@ -120,9 +147,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

#endregion

#region 获取数据
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
@@ -135,6 +163,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 1);

foreach (var item in data)
{
var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.SFileId}'";
var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.SFileId}'";
var readdt = sys_SendFileIBLL.Execute(sql);
var senddt = sys_SendFileIBLL.Execute(sendSql);
var readcount = readdt.Rows[0][0];
var sendcount = senddt.Rows[0][0];
item.NumberPeople = $"{readcount}/{sendcount}";
}

var jsonData = new
{
rows = data,
@@ -144,6 +184,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

[HttpGet]
[AjaxOnly]
public ActionResult GetPageListDocument(string pagination, string queryJson)
@@ -159,12 +200,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

[HttpGet]
[AjaxOnly]
public ActionResult GetPageListParty(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 3);

foreach (var item in data)
{
var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.SFileId}'";
var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.SFileId}'";
var readdt = sys_SendFileIBLL.Execute(sql);
var senddt = sys_SendFileIBLL.Execute(sendSql);
var readcount = readdt.Rows[0][0];
var sendcount = senddt.Rows[0][0];
item.NumberPeople = $"{readcount}/{sendcount}";
}
var jsonData = new
{
rows = data,
@@ -174,6 +227,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

/// <summary>
/// 获取表单数据
/// <summary>
@@ -190,6 +244,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

[HttpGet]
[AjaxOnly]
public ActionResult GetFormDataView(string keyValue)
@@ -202,6 +257,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

/// <summary>
/// 获取表单数据
/// <summary>
@@ -217,9 +273,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

#endregion

#region 提交数据
#region 提交数据

/// <summary>
/// 删除实体数据
@@ -233,6 +290,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
sys_SendFileIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
@@ -249,6 +307,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
entity.STypeId = 1;
}

sys_SendFileIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}
@@ -264,6 +323,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
entity.STypeId = 2;
}

sys_SendFileIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}
@@ -279,9 +339,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
entity.STypeId = 3;
}

sys_SendFileIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}

/// <summary>
/// 提交
/// </summary>
@@ -294,6 +356,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
sys_SendFileIBLL.ChangeStatusById(keyValue, 1, processId);
return Success("操作成功!");
}

[HttpPost]
[AjaxOnly]
public ActionResult ChangeStatusByIdDocument(string keyValue)
@@ -303,6 +366,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
sys_SendFileIBLL.ChangeStatusByProcessId(guid, 2);
return Success("操作成功!");
}

/// <summary>
/// 结束下发
/// </summary>
@@ -316,6 +380,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
sys_SendFileIBLL.OverIssue(keyValue);
return Success("下发成功!");
}


/* public ActionResult ReceiveFile(string keyValue)
{
return View();
}*/

#endregion

}


+ 188
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs Прегледај датотеку

@@ -0,0 +1,188 @@
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()
{
ViewBag.Name = (LoginUserInfo.Get()).realName;
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

}
}

+ 35
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Form.cshtml Прегледај датотеку

@@ -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")

+ 41
- 0
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();
}

+ 94
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml Прегледај датотеку

@@ -0,0 +1,94 @@
@{
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>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>*@
<a id="lr_view" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;查看</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</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);
// //}),
// $.get(${ ctx } / sys / msGetUserMedia / getMsgList ? state + "&t=" + new Date().getTime(), function (data) {
// $("#notifications").html(data);
// });
//}

//winpop();
//setInterval(function() {
// $("#winpop").load(Winpop(), "");
// },
// 1000);
</script>

+ 150
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js Прегледај датотеку

@@ -0,0 +1,150 @@
/* * 版 本 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();
});
// 查看
$('#lr_view').on('click', function () {
var title = $('#gridtable').jfGridValue('TheTitle');
var keyValue = $('#gridtable').jfGridValue('InstanceId');
//var MessageId = $('#gridtable').jfGridValue('MessageId');
var ConnectionUrl = $('#gridtable').jfGridValue('ConnectionUrl');
var url = top.$.rootUrl + ConnectionUrl + keyValue;
learun.layerForm({
id: 'formview',
title: title,
url: url,
width: 1000,
height: 650,
maxmin: true,
btn: null,
});
});

},


// 初始化列表
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();

}

+ 141
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml Прегледај датотеку

@@ -0,0 +1,141 @@
@*@{
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'>
var name = '@(ViewBag.Name)';
$(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++) {
//data[i]["SenderName"]
//content += "<li>" + "&nbsp;&nbsp;&nbsp;" + name + "的消息:" + "</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 += "&nbsp;&nbsp;&nbsp;&nbsp;【" + data[i]["TheTitle"] + "】" + theContent + "&nbsp;&nbsp;";
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>

+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Прегледај датотеку

@@ -389,6 +389,7 @@
<Compile Include="Areas\LR_Desktop\Controllers\DTListController.cs" />
<Compile Include="Areas\LR_Desktop\Controllers\DTSettingController.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\LR_DesktopAreaRegistration.cs" />
<Compile Include="Areas\LR_DisplayBoard\Controllers\LR_KBConfigInfoController.cs" />
@@ -1251,6 +1252,8 @@
<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\MessageRind\Index.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" />
@@ -6957,6 +6960,9 @@
<Content Include="Areas\EducationalAdministration\Views\Sys_SendFile\PrintView.cshtml" />
<Content Include="Areas\Permission\Views\DepartmentReleasePermissions\Form.cshtml" />
<Content Include="Areas\Permission\Views\DepartmentReleasePermissions\Index.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" />
<Content Include="Views\Login\Default-beifen.cshtml" />
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" />


+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/MessageRemindMap.cs Прегледај датотеку

@@ -0,0 +1,29 @@
using Learun.Application.TwoDevelopment.LR_Desktop;
using System.Data.Entity.ModelConfiguration;

namespace Learun.Application.Mapping
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-04-23 16:58
/// 描 述:消息提醒
/// </summary>
public class MessageRemindMap : EntityTypeConfiguration<MessageRemindEntity>
{
public MessageRemindMap()
{
#region 表、主键
//表
this.ToTable("MESSAGEREMIND");
//主键
this.HasKey(t => t.MessageId);
#endregion

#region 配置关系
#endregion
}
}
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj Прегледај датотеку

@@ -110,6 +110,7 @@
<Compile Include="LR_CodeDemo\LR_OA_ProjectMap.cs" />
<Compile Include="LR_CRM\CrmCustomerContactMap.cs" />
<Compile Include="LR_CRM\CrmChanceMap.cs" />
<Compile Include="LR_Desktop\MessageRemindMap.cs" />
<Compile Include="LR_Desktop\WeChatDevelopMap.cs" />
<Compile Include="LR_Excel\ExcelExportMap.cs" />
<Compile Include="LR_Excel\ExcelImportFieldMap.cs" />


+ 95
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRemindEntity.cs Прегледај датотеку

@@ -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
}
}


+ 194
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs Прегледај датотеку

@@ -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

}
}

+ 63
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs Прегледај датотеку

@@ -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

}
}

+ 231
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs Прегледај датотеку

@@ -0,0 +1,231 @@
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.*
");
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
{
var userInfo = LoginUserInfo.Get();
return this.BaseRepository().FindList<MessageRemindEntity>(x => x.ReadSigns == false && x.ReceiptId == userInfo.userId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取MessageRemind表未读消息的数量
/// </summary>
/// <returns></returns>
public int GetCountForUnread()
{
try
{
var userInfo = LoginUserInfo.Get();
string sql = "select count(1) from MessageRemind where ReadSigns=0 ";

sql += $" and ReceiptId='{userInfo.userId}'";

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

}
}

+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj Прегледај датотеку

@@ -256,6 +256,10 @@
<Compile Include="LR_CodeDemo\WorkOrder\WorkOrderBLL.cs" />
<Compile Include="LR_CodeDemo\WorkOrder\WorkOrderIBLL.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\WeChatDevelopEntity.cs" />
<Compile Include="LR_Desktop\WeChatDevelop\WeChatDevelopIBLL.cs" />


Loading…
Откажи
Сачувај