@@ -41,6 +41,10 @@ | |||
<div class="lr-form-item-title">部门</div> | |||
<div id="AIDepartment"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">使用人员</div> | |||
<div id="AIUsePeople"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">资产名称</div> | |||
<input id="AIASSName" type="text" class="form-control" /> | |||
@@ -40,7 +40,12 @@ var bootstrap = function ($, learun) { | |||
}, 400, 400); | |||
$('#AIIStorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); | |||
$('#AIASSState').lrDataItemSelect({ code: 'AssState' }); | |||
$('#AIDepartment').lrDepartmentSelect(); | |||
$('#AIDepartment').lrDepartmentSelect({select:function(val) { | |||
console.log(val.value); | |||
$('#AIUsePeople').lrselectRefresh({ url: top.$.rootUrl +'/LR_OrganizationModule/User/GetListByDepartmentId?departmentId='+val.value,text:'F_RealName',value:'F_UserId'}) | |||
}}); | |||
$('#AIUsePeople').lrselect({ text: 'F_RealName', value:'F_UserId'}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
@@ -16,6 +16,7 @@ using Microsoft.AspNet.SignalR.Client; | |||
using Microsoft.Owin.Logging; | |||
using Newtonsoft.Json; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Application.TwoDevelopment.Permission; | |||
namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
{ | |||
@@ -36,6 +37,7 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
private DataItemIBLL dataItemIbll = new DataItemBLL(); | |||
private DepartmentIBLL departmentIbll = new DepartmentBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
private DepartmentReleasePermissionsIBLL departmentReleasePermissionsIbll=new DepartmentReleasePermissionsBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 管理页面 | |||
@@ -249,15 +251,16 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
return JsonResult(data); | |||
} | |||
public ActionResult GetNoticeCategoryByDepartment(string departmentId) | |||
public ActionResult GetNoticeCategoryByDepartment(string userId) | |||
{ | |||
var typeList = dataItemIbll.GetDetailList("NoticeCategory"); | |||
var departmentEntity = departmentIbll.GetEntity(departmentId); | |||
var permissionsEntity= departmentReleasePermissionsIbll.GetTypesByUserId(userId); | |||
List<object> list = new List<object>(); | |||
if (departmentEntity != null) | |||
if (permissionsEntity != null) | |||
{ | |||
var typetext = departmentEntity.NoticeCategory?.Split(','); | |||
var typetext = permissionsEntity.Permission?.Split(','); | |||
foreach (var item in typetext) | |||
{ | |||
@@ -28,7 +28,7 @@ var bootstrap = function ($, learun) { | |||
var loginInfo = top.learun.clientdata.get(['userinfo']); | |||
//公告类别 | |||
$('#F_CategoryId').lrselect({ | |||
url: top.$.rootUrl + '/LR_OAModule/Notice/GetNoticeCategoryByDepartment?departmentId=' + loginInfo.departmentId, | |||
url: top.$.rootUrl + '/LR_OAModule/Notice/GetNoticeCategoryByDepartment?userId=' + loginInfo.userId, | |||
text: "text", | |||
value: "value", | |||
select: function (item) { | |||
@@ -36,10 +36,10 @@ | |||
<div id="F_SchoolMasterId" ></div> | |||
<input type="hidden" id="F_SchoolMaster"/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
@*<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">公告类别</div> | |||
<div id="NoticeCategory" ></div> | |||
</div> | |||
</div>*@ | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">电话号</div> | |||
<input id="F_OuterPhone" type="text" class="form-control" /> | |||
@@ -38,7 +38,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
}); | |||
$('#NoticeCategory').lrDataItemSelect({ code: 'NoticeCategory', type: 'multiple', allowSearch:true }); | |||
//$('#NoticeCategory').lrDataItemSelect({ code: 'NoticeCategory', type: 'multiple', allowSearch:true }); | |||
}, | |||
initData: function () { | |||
if (!!selectedRow) { | |||
@@ -32,6 +32,7 @@ | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> <span class="lrlt">录入</span></a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlt">修改</span></a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlt">删除</span></a> | |||
<a id="lr_permission" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlt">公告发布权限设置</span></a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -61,6 +61,25 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
// 公告发布权限设置 | |||
$('#lr_permission').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('F_DepartmentId'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '权限设置', | |||
url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/Index?departmentId=' + keyValue, | |||
width: 700, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('F_DepartmentId'); | |||
@@ -106,18 +125,18 @@ var bootstrap = function ($, learun) { | |||
} | |||
}); | |||
}}, | |||
{ | |||
label: "公告类别", name: "NoticeCategory", width: 200, align: "left" , | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getsAsync('dataItem', { | |||
key: value, | |||
code: 'NoticeCategory', | |||
callback: function (_data) { | |||
callback(_data); | |||
} | |||
}); | |||
} | |||
}, | |||
//{ | |||
// label: "公告类别", name: "NoticeCategory", width: 200, align: "left" , | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getsAsync('dataItem', { | |||
// key: value, | |||
// code: 'NoticeCategory', | |||
// callback: function (_data) { | |||
// callback(_data); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "电话号", name: "F_OuterPhone", width: 100, align: "left" }, | |||
{ label: "分机号", name: "F_InnerPhone", width: 60, align: "center" }, | |||
{ label: "排序", name: "F_Order", width: 60, align: "center" }, | |||
@@ -0,0 +1,117 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.Permission; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.Permission.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-12-22 11:35 | |||
/// 描 述:公告发布权限设置 | |||
/// </summary> | |||
public class DepartmentReleasePermissionsController : MvcControllerBase | |||
{ | |||
private DepartmentReleasePermissionsIBLL departmentReleasePermissionsIBLL = new DepartmentReleasePermissionsBLL(); | |||
#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 = departmentReleasePermissionsIBLL.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 DepartmentReleasePermissionsData = departmentReleasePermissionsIBLL.GetDepartmentReleasePermissionsEntity( keyValue ); | |||
var jsonData = new { | |||
DepartmentReleasePermissions = DepartmentReleasePermissionsData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
departmentReleasePermissionsIBLL.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) | |||
{ | |||
DepartmentReleasePermissionsEntity entity = strEntity.ToObject<DepartmentReleasePermissionsEntity>(); | |||
departmentReleasePermissionsIBLL.SaveEntity(keyValue,entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
@{ | |||
ViewBag.Title = "公告发布权限设置"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="DepartmentReleasePermissions" > | |||
<div class="lr-form-item-title">发布人员</div> | |||
<div id="UserID" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="DepartmentReleasePermissions" > | |||
<div class="lr-form-item-title">公告类型</div> | |||
<div id="Permission" ></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/Permission/Views/DepartmentReleasePermissions/Form.js") |
@@ -0,0 +1,56 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-12-22 11:35 | |||
* 描 述:公告发布权限设置 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var departmentId = request('departmentId'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
console.log(departmentId); | |||
$('#UserID').lrselect({ url: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByDepartmentId?departmentId=' + departmentId, value: 'F_UserId', text: 'F_RealName' }); | |||
$('#Permission').lrDataItemSelect({ code: 'NoticeCategory', type: 'multiple' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/Permission/DepartmentReleasePermissions/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]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var formdata = $('body').lrGetFormData(); | |||
formdata.DepartmentID = departmentId; | |||
var postData = { | |||
strEntity: JSON.stringify(formdata) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/Permission/DepartmentReleasePermissions/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,36 @@ | |||
@{ | |||
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="DepartmentID"></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> 新增</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> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/Permission/Views/DepartmentReleasePermissions/Index.js") |
@@ -0,0 +1,112 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-12-22 11:35 | |||
* 描 述:公告发布权限设置 | |||
*/ | |||
var refreshGirdData; | |||
var departmentId = request('departmentId'); | |||
console.log(123 + departmentId); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
console.log(departmentId); | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#DepartmentID').lrDataSourceSelect({ code: 'classdata',value: 'id',text: 'name' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form1', | |||
title: '新增', | |||
url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/Form?departmentId='+departmentId, | |||
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: 'form1', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/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 + '/Permission/DepartmentReleasePermissions/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/GetPageList', | |||
headData: [ | |||
{ label: "发布人员", name: "UserID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op,$cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
key: value, | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
}}, | |||
{ label: "公告类型", name: "Permission", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getsAsync('dataItem', { | |||
key: value, | |||
code: 'NoticeCategory', | |||
callback: function (_data) { | |||
callback(_data); | |||
} | |||
}); | |||
}}, | |||
], | |||
mainId:'ID', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.DepartmentID = departmentId; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -791,6 +791,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\LoginUserBindController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_InformationPushController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuLeaveManagementController.cs" /> | |||
<Compile Include="Areas\Permission\Controllers\DepartmentReleasePermissionsController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -6118,6 +6119,10 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\Form.js" /> | |||
<Content Include="Areas\Permission\Views\DepartmentReleasePermissions\Index.cshtml" /> | |||
<Content Include="Areas\Permission\Views\DepartmentReleasePermissions\Index.js" /> | |||
<Content Include="Areas\Permission\Views\DepartmentReleasePermissions\Form.cshtml" /> | |||
<Content Include="Areas\Permission\Views\DepartmentReleasePermissions\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\LR_Desktop\Models\" /> | |||
@@ -543,6 +543,7 @@ | |||
<Compile Include="EducationalAdministration\LoginUserBindMap.cs" /> | |||
<Compile Include="EducationalAdministration\Sys_InformationPushMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagementMap.cs" /> | |||
<Compile Include="Permission\DepartmentReleasePermissionsMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.Permission; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-12-22 11:35 | |||
/// 描 述:公告发布权限设置 | |||
/// </summary> | |||
public class DepartmentReleasePermissionsMap : EntityTypeConfiguration<DepartmentReleasePermissionsEntity> | |||
{ | |||
public DepartmentReleasePermissionsMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("DEPARTMENTRELEASEPERMISSIONS"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -59,6 +59,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
dp.Add("AIAssType", queryParam["AIAssType"].ToString(), DbType.String); | |||
strSql.Append(" AND t.AIAssType = @AIAssType "); | |||
} | |||
if (!queryParam["AIUsePeople"].IsEmpty()) | |||
{ | |||
dp.Add("AIUsePeople", queryParam["AIUsePeople"].ToString(), DbType.String); | |||
strSql.Append(" AND t.AIUsePeople = @AIUsePeople "); | |||
} | |||
if (!queryParam["AIDepartment"].IsEmpty()) | |||
{ | |||
@@ -1593,6 +1593,10 @@ | |||
<Compile Include="EducationalAdministration\StuLeaveManagement\StuLeaveManagementService.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagement\StuLeaveManagementBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagement\StuLeaveManagementIBLL.cs" /> | |||
<Compile Include="Permission\DepartmentReleasePermissions\DepartmentReleasePermissionsEntity.cs" /> | |||
<Compile Include="Permission\DepartmentReleasePermissions\DepartmentReleasePermissionsService.cs" /> | |||
<Compile Include="Permission\DepartmentReleasePermissions\DepartmentReleasePermissionsBLL.cs" /> | |||
<Compile Include="Permission\DepartmentReleasePermissions\DepartmentReleasePermissionsIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,144 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.Permission | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-12-22 11:35 | |||
/// 描 述:公告发布权限设置 | |||
/// </summary> | |||
public class DepartmentReleasePermissionsBLL : DepartmentReleasePermissionsIBLL | |||
{ | |||
private DepartmentReleasePermissionsService departmentReleasePermissionsService = new DepartmentReleasePermissionsService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<DepartmentReleasePermissionsEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return departmentReleasePermissionsService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取DepartmentReleasePermissions表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public DepartmentReleasePermissionsEntity GetDepartmentReleasePermissionsEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return departmentReleasePermissionsService.GetDepartmentReleasePermissionsEntity(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 | |||
{ | |||
departmentReleasePermissionsService.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, DepartmentReleasePermissionsEntity entity) | |||
{ | |||
try | |||
{ | |||
departmentReleasePermissionsService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public DepartmentReleasePermissionsEntity GetTypesByUserId(string userId) | |||
{ | |||
try | |||
{ | |||
return departmentReleasePermissionsService.GetTypesByUserId(userId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,60 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.Permission | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-12-22 11:35 | |||
/// 描 述:公告发布权限设置 | |||
/// </summary> | |||
public class DepartmentReleasePermissionsEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// 编号 | |||
/// </summary> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 部门 | |||
/// </summary> | |||
[Column("DEPARTMENTID")] | |||
public string DepartmentID { get; set; } | |||
/// <summary> | |||
/// 人员 | |||
/// </summary> | |||
[Column("USERID")] | |||
public string UserID { get; set; } | |||
/// <summary> | |||
/// 权限 | |||
/// </summary> | |||
[Column("PERMISSION")] | |||
public string Permission { 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 | |||
} | |||
} | |||
@@ -0,0 +1,49 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.Permission | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-12-22 11:35 | |||
/// 描 述:公告发布权限设置 | |||
/// </summary> | |||
public interface DepartmentReleasePermissionsIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<DepartmentReleasePermissionsEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取DepartmentReleasePermissions表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
DepartmentReleasePermissionsEntity GetDepartmentReleasePermissionsEntity(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, DepartmentReleasePermissionsEntity entity); | |||
#endregion | |||
DepartmentReleasePermissionsEntity GetTypesByUserId(string userId); | |||
} | |||
} |
@@ -0,0 +1,169 @@ | |||
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.Permission | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-12-22 11:35 | |||
/// 描 述:公告发布权限设置 | |||
/// </summary> | |||
public class DepartmentReleasePermissionsService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<DepartmentReleasePermissionsEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.ID, | |||
t.UserID, | |||
t.Permission | |||
"); | |||
strSql.Append(" FROM DepartmentReleasePermissions t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["DepartmentID"].IsEmpty()) | |||
{ | |||
dp.Add("DepartmentID",queryParam["DepartmentID"].ToString(), DbType.String); | |||
strSql.Append(" AND t.DepartmentID = @DepartmentID "); | |||
} | |||
return this.BaseRepository().FindList<DepartmentReleasePermissionsEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取DepartmentReleasePermissions表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public DepartmentReleasePermissionsEntity GetDepartmentReleasePermissionsEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<DepartmentReleasePermissionsEntity>(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<DepartmentReleasePermissionsEntity>(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, DepartmentReleasePermissionsEntity 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 | |||
public DepartmentReleasePermissionsEntity GetTypesByUserId(string userId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<DepartmentReleasePermissionsEntity>(a=>a.UserID==userId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} | |||
} |