@@ -0,0 +1,126 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||||
using System.Web.Mvc; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-10-21 09:52 | |||||
/// 描 述:学校邮箱管理 | |||||
/// </summary> | |||||
public class EmailManagementController : MvcControllerBase | |||||
{ | |||||
private EmailManagementIBLL emailManagementIBLL = new EmailManagementBLL(); | |||||
#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 = emailManagementIBLL.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 EmailManagementData = emailManagementIBLL.GetEmailManagementEntity( keyValue ); | |||||
var jsonData = new { | |||||
EmailManagement = EmailManagementData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
emailManagementIBLL.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) | |||||
{ | |||||
EmailManagementEntity entity = strEntity.ToObject<EmailManagementEntity>(); | |||||
emailManagementIBLL.SaveEntity(keyValue,entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 启用 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DoEnabled(string keyValue) | |||||
{ | |||||
emailManagementIBLL.DoEnabled(keyValue); | |||||
return Success("操作成功!"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,35 @@ | |||||
@{ | |||||
ViewBag.Title = "学校邮箱管理"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="EmailManagement" > | |||||
<div class="lr-form-item-title">发件邮箱账号<font face="宋体">*</font></div> | |||||
<input id="F_Account" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="EmailManagement" > | |||||
<div class="lr-form-item-title">发件邮箱密码<font face="宋体">*</font></div> | |||||
<input id="F_Password" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="EmailManagement" > | |||||
<div class="lr-form-item-title">发件邮箱名称<font face="宋体">*</font></div> | |||||
<input id="F_SenderName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="EmailManagement"> | |||||
<div class="lr-form-item-title">定时发送小时<font face="宋体">*</font></div> | |||||
<div id="F_Hour" isvalid="yes" checkexpession="NotNull" ></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="EmailManagement"> | |||||
<div class="lr-form-item-title">定时发送分钟</div> | |||||
<div id="F_Minute" ></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="EmailManagement" > | |||||
<div class="lr-form-item-title">启用</div> | |||||
<div id="F_EnabledMark"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="EmailManagement" > | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="F_Description" class="form-control" style="height:100px;" ></textarea> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/EmailManagement/Form.js") |
@@ -0,0 +1,67 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2022-10-21 09:52 | |||||
* 描 述:学校邮箱管理 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
$('.lr-form-wrap').lrscroll(); | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#F_EnabledMark').lrRadioCheckbox({ | |||||
type: 'radio', | |||||
code: 'YesOrNoInt', | |||||
}); | |||||
$('#F_Hour').lrselect({ data: getArray(24), allowSearch: true }); | |||||
$('#F_Minute').lrselect({ data: getArray(60), allowSearch: true }); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/PersonnelManagement/EmailManagement/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 postData = { | |||||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/EmailManagement/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} | |||||
function getArray(max) { | |||||
var aa = []; | |||||
for (var i = 0; i < max; i++) { | |||||
var item = { text: ''+i+'', id: ''+i+'' }; | |||||
aa.push(item); | |||||
} | |||||
return aa; | |||||
} |
@@ -0,0 +1,27 @@ | |||||
@{ | |||||
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> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
<a id="lr_enabled" class="btn btn-default"><i class="fa fa-plus"></i> 启用</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/EmailManagement/Index.js") |
@@ -0,0 +1,119 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2022-10-21 09:52 | |||||
* 描 述:学校邮箱管理 | |||||
*/ | |||||
var refreshGirdData; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.initGird(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '新增', | |||||
url: top.$.rootUrl + '/PersonnelManagement/EmailManagement/Form', | |||||
width: 800, | |||||
height: 600, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/PersonnelManagement/EmailManagement/Form?keyValue=' + keyValue, | |||||
width: 800, | |||||
height: 600, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
var F_EnabledMark = $('#gridtable').jfGridValue('F_EnabledMark'); | |||||
if (F_EnabledMark == "1") { | |||||
learun.alert.warning("当前项已启用,无法删除!"); | |||||
return false; | |||||
} | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/EmailManagement/DeleteForm', { keyValue: keyValue}, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 启用 | |||||
$('#lr_enabled').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
var F_EnabledMark = $('#gridtable').jfGridValue('F_EnabledMark'); | |||||
if (F_EnabledMark == "1") { | |||||
learun.alert.warning("当前项已启用!"); | |||||
return false; | |||||
} | |||||
learun.layerConfirm('启用操作将会对已启用的项目进行禁用,是否确认启用该项!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/PersonnelManagement/EmailManagement/DoEnabled', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
// 初始化列表 | |||||
initGird: function () { | |||||
$('#gridtable').lrAuthorizeJfGrid({ | |||||
url: top.$.rootUrl + '/PersonnelManagement/EmailManagement/GetPageList', | |||||
headData: [ | |||||
{ label: "发件邮箱账号", name: "F_Account", width: 200, align: "left"}, | |||||
{ label: "发件邮箱密码", name: "F_Password", width: 200, align: "left"}, | |||||
{ label: "发件邮箱名称", name: "F_SenderName", width: 200, align: "left"}, | |||||
{ label: "定时发送小时", name: "F_Hour", width: 150, align: "left"}, | |||||
{ label: "定时发送分钟", name: "F_Minute", width: 150, align: "left"}, | |||||
{ | |||||
label: "是否启用", name: "F_EnabledMark", width: 80, align: "center", | |||||
formatter: function (cellvalue) { | |||||
return cellvalue == "1" ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||||
} | |||||
}, | |||||
], | |||||
mainId:'F_Id', | |||||
isPage: true | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||||
} | |||||
}; | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -845,6 +845,7 @@ | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\HealthPunchStuController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\HealthPunchStuController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\Acc_DormitoryChangeController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\Acc_DormitoryChangeController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\VaccinationInfoController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\VaccinationInfoController.cs" /> | ||||
<Compile Include="Areas\PersonnelManagement\Controllers\EmailManagementController.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | <Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | ||||
@@ -6619,6 +6620,10 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\VaccinationInfo\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\VaccinationInfo\Index.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\VaccinationInfo\Form.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\VaccinationInfo\Form.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\VaccinationInfo\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\VaccinationInfo\Form.js" /> | ||||
<Content Include="Areas\PersonnelManagement\Views\EmailManagement\Index.cshtml" /> | |||||
<Content Include="Areas\PersonnelManagement\Views\EmailManagement\Index.js" /> | |||||
<Content Include="Areas\PersonnelManagement\Views\EmailManagement\Form.cshtml" /> | |||||
<Content Include="Areas\PersonnelManagement\Views\EmailManagement\Form.js" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Folder Include="Areas\EducationalAdministration\Views\HomeStatistics\" /> | <Folder Include="Areas\EducationalAdministration\Views\HomeStatistics\" /> | ||||
@@ -599,6 +599,7 @@ | |||||
<Compile Include="EducationalAdministration\ArrangeExamTermNewMap.cs" /> | <Compile Include="EducationalAdministration\ArrangeExamTermNewMap.cs" /> | ||||
<Compile Include="LR_Desktop\EnrollTemplateMap.cs" /> | <Compile Include="LR_Desktop\EnrollTemplateMap.cs" /> | ||||
<Compile Include="LR_Desktop\EnrollDataMap.cs" /> | <Compile Include="LR_Desktop\EnrollDataMap.cs" /> | ||||
<Compile Include="PersonnelManagement\EmailManagementMap.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | <ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | ||||
@@ -0,0 +1,29 @@ | |||||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||||
using System.Data.Entity.ModelConfiguration; | |||||
namespace Learun.Application.Mapping | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-10-21 09:52 | |||||
/// 描 述:学校邮箱管理 | |||||
/// </summary> | |||||
public class EmailManagementMap : EntityTypeConfiguration<EmailManagementEntity> | |||||
{ | |||||
public EmailManagementMap() | |||||
{ | |||||
#region 表、主键 | |||||
//表 | |||||
this.ToTable("EMAILMANAGEMENT"); | |||||
//主键 | |||||
this.HasKey(t => t.F_Id); | |||||
#endregion | |||||
#region 配置关系 | |||||
#endregion | |||||
} | |||||
} | |||||
} | |||||
@@ -1823,6 +1823,10 @@ | |||||
<Compile Include="LR_Desktop\EnrollData\EnrollDataService.cs" /> | <Compile Include="LR_Desktop\EnrollData\EnrollDataService.cs" /> | ||||
<Compile Include="LR_Desktop\EnrollData\EnrollDataBLL.cs" /> | <Compile Include="LR_Desktop\EnrollData\EnrollDataBLL.cs" /> | ||||
<Compile Include="LR_Desktop\EnrollData\EnrollDataIBLL.cs" /> | <Compile Include="LR_Desktop\EnrollData\EnrollDataIBLL.cs" /> | ||||
<Compile Include="PersonnelManagement\EmailManagement\EmailManagementEntity.cs" /> | |||||
<Compile Include="PersonnelManagement\EmailManagement\EmailManagementService.cs" /> | |||||
<Compile Include="PersonnelManagement\EmailManagement\EmailManagementBLL.cs" /> | |||||
<Compile Include="PersonnelManagement\EmailManagement\EmailManagementIBLL.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | <ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | ||||
@@ -0,0 +1,148 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-10-21 09:52 | |||||
/// 描 述:学校邮箱管理 | |||||
/// </summary> | |||||
public class EmailManagementBLL : EmailManagementIBLL | |||||
{ | |||||
private EmailManagementService emailManagementService = new EmailManagementService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<EmailManagementEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return emailManagementService.GetPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取EmailManagement表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public EmailManagementEntity GetEmailManagementEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return emailManagementService.GetEmailManagementEntity(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 | |||||
{ | |||||
emailManagementService.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, EmailManagementEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
emailManagementService.SaveEntity(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 启用 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DoEnabled(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
emailManagementService.DoEnabled(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,112 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.ComponentModel.DataAnnotations.Schema; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-10-21 09:51 | |||||
/// 描 述:学校邮箱管理 | |||||
/// </summary> | |||||
public class EmailManagementEntity | |||||
{ | |||||
#region 实体成员 | |||||
/// <summary> | |||||
/// 邮件账户主键 | |||||
/// </summary> | |||||
[Column("F_ID")] | |||||
public string F_Id { get; set; } | |||||
/// <summary> | |||||
/// 账户 | |||||
/// </summary> | |||||
[Column("F_ACCOUNT")] | |||||
public string F_Account { get; set; } | |||||
/// <summary> | |||||
/// 密码 | |||||
/// </summary> | |||||
[Column("F_PASSWORD")] | |||||
public string F_Password { get; set; } | |||||
/// <summary> | |||||
/// 发件人名称 | |||||
/// </summary> | |||||
[Column("F_SENDERNAME")] | |||||
public string F_SenderName { get; set; } | |||||
/// <summary> | |||||
/// 描述 | |||||
/// </summary> | |||||
[Column("F_DESCRIPTION")] | |||||
public string F_Description { get; set; } | |||||
/// <summary> | |||||
/// 有效标志 | |||||
/// </summary> | |||||
[Column("F_ENABLEDMARK")] | |||||
public int? F_EnabledMark { get; set; } | |||||
/// <summary> | |||||
/// 创建时间 | |||||
/// </summary> | |||||
[Column("F_CREATORTIME")] | |||||
public DateTime? F_CreatorTime { get; set; } | |||||
/// <summary> | |||||
/// 创建用户 | |||||
/// </summary> | |||||
[Column("F_CREATORUSERID")] | |||||
public string F_CreatorUserId { get; set; } | |||||
/// <summary> | |||||
/// 定时发送时间类型(天、周、月、年、) | |||||
/// </summary> | |||||
[Column("F_CRONTYPE")] | |||||
public string F_CronType { get; set; } | |||||
/// <summary> | |||||
/// 定时发送月 | |||||
/// </summary> | |||||
[Column("F_MONTH")] | |||||
public int? F_Month { get; set; } | |||||
/// <summary> | |||||
/// 定时发送日 | |||||
/// </summary> | |||||
[Column("F_DAY")] | |||||
public int? F_Day { get; set; } | |||||
/// <summary> | |||||
/// 定时发送时 | |||||
/// </summary> | |||||
[Column("F_HOUR")] | |||||
public int? F_Hour { get; set; } | |||||
/// <summary> | |||||
/// 定时发送分 | |||||
/// </summary> | |||||
[Column("F_MINUTE")] | |||||
public int? F_Minute { get; set; } | |||||
/// <summary> | |||||
/// 定时发送周 | |||||
/// </summary> | |||||
[Column("F_DAYOFWEEK")] | |||||
public int? F_DayOfWeek { get; set; } | |||||
#endregion | |||||
#region 扩展操作 | |||||
/// <summary> | |||||
/// 新增调用 | |||||
/// </summary> | |||||
public void Create() | |||||
{ | |||||
this.F_Id = Guid.NewGuid().ToString(); | |||||
this.F_CreatorTime = DateTime.Now; | |||||
this.F_CreatorUserId = LoginUserInfo.Get().userId; | |||||
} | |||||
/// <summary> | |||||
/// 编辑调用 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void Modify(string keyValue) | |||||
{ | |||||
this.F_Id = keyValue; | |||||
} | |||||
#endregion | |||||
#region 扩展字段 | |||||
#endregion | |||||
} | |||||
} | |||||
@@ -0,0 +1,53 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-10-21 09:52 | |||||
/// 描 述:学校邮箱管理 | |||||
/// </summary> | |||||
public interface EmailManagementIBLL | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<EmailManagementEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取EmailManagement表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
EmailManagementEntity GetEmailManagementEntity(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, EmailManagementEntity entity); | |||||
/// <summary> | |||||
/// 启用 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
void DoEnabled(string keyValue); | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,180 @@ | |||||
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.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-10-21 09:52 | |||||
/// 描 述:学校邮箱管理 | |||||
/// </summary> | |||||
public class EmailManagementService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<EmailManagementEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" | |||||
t.F_Id, | |||||
t.F_Account, | |||||
t.F_Password, | |||||
t.F_SenderName, | |||||
t.F_Hour, | |||||
t.F_Minute, | |||||
t.F_EnabledMark | |||||
"); | |||||
strSql.Append(" FROM EmailManagement t "); | |||||
strSql.Append(" WHERE 1=1 "); | |||||
var queryParam = queryJson.ToJObject(); | |||||
// 虚拟参数 | |||||
var dp = new DynamicParameters(new { }); | |||||
return this.BaseRepository().FindList<EmailManagementEntity>(strSql.ToString(),dp, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取EmailManagement表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public EmailManagementEntity GetEmailManagementEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository().FindEntity<EmailManagementEntity>(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<EmailManagementEntity>(t=>t.F_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, EmailManagementEntity 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> | |||||
public void DoEnabled(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository().BeginTrans(); | |||||
try | |||||
{ | |||||
//禁用,已启用项目 | |||||
db.ExecuteBySql("update EmailManagement set F_EnabledMark=0 where F_EnabledMark=1 "); | |||||
//启用 | |||||
db.ExecuteBySql($"update EmailManagement set F_EnabledMark=1 where F_Id='{keyValue}' "); | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |