Browse Source

【增加】增加消息提醒人员菜单。成本发票增加“管理提醒对象”按钮。

yanshi
dyy 2 years ago
parent
commit
63ceefce0a
16 changed files with 1114 additions and 0 deletions
  1. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostInvoice/Index.cshtml
  2. +14
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostInvoice/Index.js
  3. +156
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRemindPersonController.cs
  4. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Form.cshtml
  5. +86
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Form.js
  6. +48
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Index.cshtml
  7. +200
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Index.js
  8. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  9. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/MessageRemindPersonMap.cs
  10. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
  11. +61
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostInvoice/CostInvoiceService.cs
  12. +149
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonBLL.cs
  13. +95
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonEntity.cs
  14. +55
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonIBLL.cs
  15. +185
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonService.cs
  16. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostInvoice/Index.cshtml View File

@@ -20,6 +20,9 @@
<a id="lr_delete" 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=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_messageRemindPerson" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;管理提醒对象</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>


+ 14
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostInvoice/Index.js View File

@@ -90,6 +90,20 @@ var bootstrap = function ($, learun) {
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});

// 管理提醒对象
$('#lr_messageRemindPerson').on('click', function () {
learun.layerForm({
id: 'formInMessageRemindPerson',
title: '管理提醒对象',
url: top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/Form?type=03',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
});
},
// 初始化列表
initGird: function () {


+ 156
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRemindPersonController.cs View File

@@ -0,0 +1,156 @@
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.LR_Desktop;
using System.Web.Mvc;
using System.Collections.Generic;
using System;

namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-04-26 15:15
/// 描 述:消息提醒人员
/// </summary>
public class MessageRemindPersonController : MvcControllerBase
{
private MessageRemindPersonIBLL messageRemindPersonIBLL = new MessageRemindPersonBLL();

#region 视图功能

/// <summary>
/// 主页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
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 = messageRemindPersonIBLL.GetPageList(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var MessageRemindPersonData = messageRemindPersonIBLL.GetMessageRemindPersonEntity( keyValue );
var jsonData = new {
MessageRemindPerson = MessageRemindPersonData,
};
return Success(jsonData);
}

/// <summary>
/// 获取表单数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetFormDataByType(string type)
{
var MessageRemindPersonData = new MessageRemindPersonEntity();
var data = messageRemindPersonIBLL.GetEntityByType(type);
if (data != null)
{
MessageRemindPersonData = data;
}
var jsonData = new
{
MessageRemindPerson = MessageRemindPersonData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
messageRemindPersonIBLL.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)
{
var loginInfo = LoginUserInfo.Get();
MessageRemindPersonEntity entity = strEntity.ToObject<MessageRemindPersonEntity>();
if (string.IsNullOrEmpty(keyValue))
{
var data = messageRemindPersonIBLL.GetEntityByType(entity.Type);
if (data != null)
{
return Fail("当前类型已经存在提醒对象!");
}

entity.CreateTime = DateTime.Now;
entity.CreateUserId = loginInfo.userId;
entity.CreateUserName = loginInfo.realName;
}
else
{
entity.ModifyTime = DateTime.Now;
entity.ModifyUserId = loginInfo.userId;
entity.ModifyUserName = loginInfo.realName;
}
messageRemindPersonIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}
#endregion

}
}

+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Form.cshtml View File

@@ -0,0 +1,23 @@
@{
ViewBag.Title = "消息提醒人员";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="MessageRemindPerson" >
<div class="lr-form-item-title">提醒对象类型<font face="宋体">*</font></div>
<div id="Type" isvalid="yes" checkexpession="NotNull" ></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="MessageRemindPerson" >
<div class="lr-form-item-title">提醒角色</div>
<div id="RoleIds" ></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="MessageRemindPerson" >
<div class="lr-form-item-title">提醒部门</div>
<div id="DeptIds" ></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="MessageRemindPerson" >
<div class="lr-form-item-title">提醒人员</div>
<div id="UserIds" ></div>
</div>
</div>
@Html.AppendJsFile("/Areas/LR_Desktop/Views/MessageRemindPerson/Form.js")

+ 86
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Form.js View File

@@ -0,0 +1,86 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-04-26 15:15
* 描 述:消息提醒人员
*/
var acceptClick;
var keyValue = request('keyValue');
var type = request('type');//消息提醒人员类型
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#Type').lrDataItemSelect({ code: 'MessageRemindPersonType' });
$('#RoleIds').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=RoleInfo',
value: "f_roleid",
text: "f_fullname",
type: 'multiple'
});
$('#DeptIds').lrDepartmentSelect({ type: 'treemultiple' });
$('#UserIds').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata',
value: "f_userid",
text: "f_realname",
type: 'multiple'
});
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/GetFormData?keyValue=' + keyValue, function (data) {
for (var id in data) {
if (!!data[id].length && data[id].length > 0) {
$('#' + id ).jfGridSet('refreshdata', data[id]);
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
}
});
}
else if (!!type) {
$('#Type').attr('readonly', 'readonly');
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/GetFormDataByType?type=' + type, function (data) {
for (var id in data) {
if (!!data[id].length && data[id].length > 0) {
$('#' + id).jfGridSet('refreshdata', data[id]);
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
keyValue = data[id].Id;
$('#Type').lrselectSet(type);
}
});
}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('body').lrValidform()) {
return false;
}
if (keyValue == null) {
keyValue = "";
}
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
};
console.log(postData);
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}

+ 48
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Index.cshtml View File

@@ -0,0 +1,48 @@
@{
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="multiple_condition_query">
<div class="lr-query-formcontent">
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">提醒对象类型</div>
<div id="Type"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">提醒角色</div>
<div id="RoleIds"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">提醒部门</div>
<div id="DeptIds"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">提醒人员</div>
<div id="UserIds"></div>
</div>
</div>
</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>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/LR_Desktop/Views/MessageRemindPerson/Index.js")

+ 200
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRemindPerson/Index.js View File

@@ -0,0 +1,200 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-04-26 15:15
* 描 述:消息提醒人员
*/
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 220, 400);
$('#Type').lrDataItemSelect({ code: 'MessageRemindPersonType' });
$('#RoleIds').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=RoleInfo',
value: "f_roleid",
text: "f_fullname",
type: 'multiple'
});
$('#DeptIds').lrDepartmentSelect({ type: 'treemultiple' });
$('#UserIds').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata',
value: "f_userid",
text: "f_realname",
type: 'multiple'
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/Form',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/Form?keyValue=' + keyValue,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});
// 删除
$('#lr_delete').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/DeleteForm', { keyValue: keyValue}, function () {
refreshGirdData();
});
}
});
}
});
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/GetPageList',
headData: [
{ label: "提醒对象类型", name: "Type", width: 100, align: "left",
formatterAsync: function (callback, value, row, op,$cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'MessageRemindPersonType',
callback: function (_data) {
callback(_data.text);
}
});
}},
{ label: "提醒角色", name: "RoleIds", width: 200, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
if (value.indexOf(',') == -1) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'RoleInfo',
key: value,
keyId: 'f_roleid',
callback: function (_data) {
callback(_data['f_fullname']);
}
});
} else {
var html = '';
var valueArr = value.split(',');
for (var i = 0; i < valueArr.length; i++) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'RoleInfo',
key: valueArr[i],
keyId: 'f_roleid',
callback: function (_data) {
html += _data['f_fullname'];
}
});
if (i < valueArr.length - 1) {
html+=','
}
}
callback(html);
}
}},
{ label: "提醒部门", name: "DeptIds", width: 200, align: "left",
formatterAsync: function (callback, value, row, op,$cell) {
if (value.indexOf(',') == -1) {
learun.clientdata.getAsync('department', {
key: value,
callback: function (_data) {
callback(_data.name);
}
});
} else {
var html = '';
var valueArr = value.split(',');
for (var i = 0; i < valueArr.length; i++) {
learun.clientdata.getAsync('department', {
key: valueArr[i],
callback: function (_data) {
html+=_data.name;
}
});
if (i < valueArr.length - 1) {
html += ','
}
}
callback(html);
}
}},
{ label: "提醒人员", name: "UserIds", width: 200, align: "left",
formatterAsync: function (callback, value, row, op,$cell) {
if (value.indexOf(',') == -1) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
key: value,
keyId: 'f_userid',
callback: function (_data) {
callback(_data['f_realname']);
}
});
} else {
var html = '';
var valueArr = value.split(',');
for (var i = 0; i < valueArr.length; i++) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
key: valueArr[i],
keyId: 'f_userid',
callback: function (_data) {
html+=_data['f_realname'];
}
});
if (i < valueArr.length - 1) {
html += ','
}
}
callback(html);
}
}},
],
mainId:'Id',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj View File

@@ -877,6 +877,7 @@
<Compile Include="Areas\PersonnelManagement\Controllers\DT_EvaluatingIndicatorController.cs" />
<Compile Include="Areas\PersonnelManagement\Controllers\DT_EvaluationDataController.cs" />
<Compile Include="Areas\PersonnelManagement\Controllers\DT_EvaluationDataMainController.cs" />
<Compile Include="Areas\LR_Desktop\Controllers\MessageRemindPersonController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" />
@@ -6763,6 +6764,10 @@
<Content Include="Areas\PersonnelManagement\Views\DT_EvaluationDataMain\Index.js" />
<Content Include="Areas\PersonnelManagement\Views\DT_EvaluationDataMain\Form.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\DT_EvaluationDataMain\Form.js" />
<Content Include="Areas\LR_Desktop\Views\MessageRemindPerson\Index.cshtml" />
<Content Include="Areas\LR_Desktop\Views\MessageRemindPerson\Index.js" />
<Content Include="Areas\LR_Desktop\Views\MessageRemindPerson\Form.cshtml" />
<Content Include="Areas\LR_Desktop\Views\MessageRemindPerson\Form.js" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\LR_Desktop\Models\" />


+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/MessageRemindPersonMap.cs View File

@@ -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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-04-26 15:15
/// 描 述:消息提醒人员
/// </summary>
public class MessageRemindPersonMap : EntityTypeConfiguration<MessageRemindPersonEntity>
{
public MessageRemindPersonMap()
{
#region 表、主键
//表
this.ToTable("MESSAGEREMINDPERSON");
//主键
this.HasKey(t => t.Id);
#endregion

#region 配置关系
#endregion
}
}
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj View File

@@ -626,6 +626,7 @@
<Compile Include="PersonnelManagement\DT_EvaluatingIndicatorMap.cs" />
<Compile Include="PersonnelManagement\DT_EvaluationDataMap.cs" />
<Compile Include="PersonnelManagement\DT_EvaluationDataMainMap.cs" />
<Compile Include="LR_Desktop\MessageRemindPersonMap.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


+ 61
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostInvoice/CostInvoiceService.cs View File

@@ -1,9 +1,13 @@
using Dapper;
using Learun.Application.Base.AuthorizeModule;
using Learun.Application.Organization;
using Learun.Application.TwoDevelopment.LR_Desktop;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Learun.Application.TwoDevelopment.CustomFunction
@@ -153,6 +157,63 @@ namespace Learun.Application.TwoDevelopment.CustomFunction
entity.Create();
this.BaseRepository("CollegeMIS").Insert(entity);
}
//提醒对象发消息提醒
var messageRemindPerson = this.BaseRepository().FindEntity<MessageRemindPersonEntity>(x => x.Type == "03");
if (messageRemindPerson != null)
{
//提醒对象包含的人员列表
var personList = new List<string>();
//角色
if (!string.IsNullOrEmpty(messageRemindPerson.RoleIds))
{
var pp = this.BaseRepository().FindList<UserRelationEntity>(x => messageRemindPerson.RoleIds.Contains(x.F_ObjectId));
if (pp.Any())
{
personList.AddRange(pp.Select(x => x.F_UserId));
}
}
//部门
if (!string.IsNullOrEmpty(messageRemindPerson.DeptIds))
{
var dd = messageRemindPerson.DeptIds.Split(',');
foreach (var item in dd)
{
var pp = this.BaseRepository().FindList<UserEntity>(x => x.F_DepartmentId.Contains(item));
if (pp.Any())
{
personList.AddRange(pp.Select(x => x.F_UserId));
}
}
}
//人员
if (!string.IsNullOrEmpty(messageRemindPerson.UserIds))
{
personList.AddRange(messageRemindPerson.UserIds.Split(','));
}
personList = personList.Distinct().ToList();
//消息提醒表增加数据
var mrList = new List<MessageRemindEntity>();
foreach (var item in personList)
{
MessageRemindEntity messageRemindEntity = new MessageRemindEntity()
{
ReceiptId = item,
ReceiptName = this.BaseRepository().FindEntity<UserEntity>(x => x.F_UserId == item)?.F_RealName,
SenderId = LoginUserInfo.Get().userId,
SenderName = LoginUserInfo.Get().realName,
TheTitle = "成本发票",
TheContent = "发票状态:" + (entity.Status.HasValue ? entity.Status.Value == 1 ? "已收票" : "未收票" : "未收票"),
ConnectionUrl = "/CustomFunction/CostInvoice/Index?keyValue=",
InstanceId = entity.Id,
SendTime = DateTime.Now,
ReadSigns = false
};
messageRemindEntity.Create();
mrList.Add(messageRemindEntity);
}
this.BaseRepository().Insert(mrList);
}

}
catch (Exception ex)
{


+ 149
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonBLL.cs View File

@@ -0,0 +1,149 @@
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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-04-26 15:15
/// 描 述:消息提醒人员
/// </summary>
public class MessageRemindPersonBLL : MessageRemindPersonIBLL
{
private MessageRemindPersonService messageRemindPersonService = new MessageRemindPersonService();

#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<MessageRemindPersonEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return messageRemindPersonService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取MessageRemindPerson表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public MessageRemindPersonEntity GetMessageRemindPersonEntity(string keyValue)
{
try
{
return messageRemindPersonService.GetMessageRemindPersonEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取MessageRemindPerson表实体数据
/// </summary>
/// <param name="type">消息提醒人员类型</param>
/// <returns></returns>
public MessageRemindPersonEntity GetEntityByType(string type)
{
try
{
return messageRemindPersonService.GetEntityByType(type);
}
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
{
messageRemindPersonService.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, MessageRemindPersonEntity entity)
{
try
{
messageRemindPersonService.SaveEntity(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}
}

+ 95
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonEntity.cs View File

@@ -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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-04-26 15:15
/// 描 述:消息提醒人员
/// </summary>
public class MessageRemindPersonEntity
{
#region 实体成员
/// <summary>
/// Id
/// </summary>
[Column("ID")]
public string Id { get; set; }
/// <summary>
/// Type
/// </summary>
[Column("TYPE")]
public string Type { get; set; }
/// <summary>
/// RoleIds
/// </summary>
[Column("ROLEIDS")]
public string RoleIds { get; set; }
/// <summary>
/// DeptIds
/// </summary>
[Column("DEPTIDS")]
public string DeptIds { get; set; }
/// <summary>
/// UserIds
/// </summary>
[Column("USERIDS")]
public string UserIds { get; set; }
/// <summary>
/// CreateUserId
/// </summary>
[Column("CREATEUSERID")]
public string CreateUserId { get; set; }
/// <summary>
/// CreateUserName
/// </summary>
[Column("CREATEUSERNAME")]
public string CreateUserName { get; set; }
/// <summary>
/// CreateTime
/// </summary>
[Column("CREATETIME")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// ModifyUserId
/// </summary>
[Column("MODIFYUSERID")]
public string ModifyUserId { get; set; }
/// <summary>
/// ModifyUserName
/// </summary>
[Column("MODIFYUSERNAME")]
public string ModifyUserName { get; set; }
/// <summary>
/// ModifyTime
/// </summary>
[Column("MODIFYTIME")]
public DateTime? ModifyTime { get; set; }
#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.Id = Guid.NewGuid().ToString();
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.Id = keyValue;
}
#endregion
#region 扩展字段
#endregion
}
}


+ 55
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonIBLL.cs View File

@@ -0,0 +1,55 @@
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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-04-26 15:15
/// 描 述:消息提醒人员
/// </summary>
public interface MessageRemindPersonIBLL
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<MessageRemindPersonEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 获取MessageRemindPerson表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
MessageRemindPersonEntity GetMessageRemindPersonEntity(string keyValue);

/// <summary>
/// 获取MessageRemindPerson表实体数据
/// </summary>
/// <param name="type">消息提醒人员类型</param>
/// <returns></returns>
MessageRemindPersonEntity GetEntityByType(string type);
#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, MessageRemindPersonEntity entity);
#endregion

}
}

+ 185
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRemindPerson/MessageRemindPersonService.cs View File

@@ -0,0 +1,185 @@
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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-04-26 15:15
/// 描 述:消息提醒人员
/// </summary>
public class MessageRemindPersonService : RepositoryFactory
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">查询参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<MessageRemindPersonEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT t.* ");
strSql.Append(" FROM MessageRemindPerson t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["Type"].IsEmpty())
{
dp.Add("Type", queryParam["Type"].ToString(), DbType.String);
strSql.Append(" AND t.Type = @Type ");
}
if (!queryParam["RoleIds"].IsEmpty())
{
dp.Add("RoleIds", queryParam["RoleIds"].ToString(), DbType.String);
strSql.Append(" AND t.RoleIds = @RoleIds ");
}
if (!queryParam["DeptIds"].IsEmpty())
{
dp.Add("DeptIds", queryParam["DeptIds"].ToString(), DbType.String);
strSql.Append(" AND t.DeptIds = @DeptIds ");
}
if (!queryParam["UserIds"].IsEmpty())
{
dp.Add("UserIds", queryParam["UserIds"].ToString(), DbType.String);
strSql.Append(" AND t.UserIds = @UserIds ");
}
return this.BaseRepository().FindList<MessageRemindPersonEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取MessageRemindPerson表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public MessageRemindPersonEntity GetMessageRemindPersonEntity(string keyValue)
{
try
{
return this.BaseRepository().FindEntity<MessageRemindPersonEntity>(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取MessageRemindPerson表实体数据
/// </summary>
/// <param name="type">消息提醒人员类型</param>
/// <returns></returns>
public MessageRemindPersonEntity GetEntityByType(string type)
{
try
{
return this.BaseRepository().FindEntity<MessageRemindPersonEntity>(x => x.Type == type);
}
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<MessageRemindPersonEntity>(t => t.Id == 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, MessageRemindPersonEntity 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);
}
}
}

#endregion

}
}

+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj View File

@@ -1923,6 +1923,10 @@
<Compile Include="PersonnelManagement\DT_EvaluationDataMain\DT_EvaluationDataMainService.cs" />
<Compile Include="PersonnelManagement\DT_EvaluationDataMain\DT_EvaluationDataMainBLL.cs" />
<Compile Include="PersonnelManagement\DT_EvaluationDataMain\DT_EvaluationDataMainIBLL.cs" />
<Compile Include="LR_Desktop\MessageRemindPerson\MessageRemindPersonEntity.cs" />
<Compile Include="LR_Desktop\MessageRemindPerson\MessageRemindPersonService.cs" />
<Compile Include="LR_Desktop\MessageRemindPerson\MessageRemindPersonBLL.cs" />
<Compile Include="LR_Desktop\MessageRemindPerson\MessageRemindPersonIBLL.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


Loading…
Cancel
Save